[Protra-users 27] MA Cross.pt システムを、 RCI に変更する。

Back to archive index

pirom pas pirom****@yahoo*****
2007年 10月 3日 (水) 23:46:22 JST


こんにちわ。
pirompasと申します。
MA Cross.pt -- 10/40移動平均交差システム by Richard
Donchian
の中のMAをRCIに変更して、RCI Cross.ptにすると、
勝率90%以上になって、
喜んだんですが、
履歴検索で、売りの株価が、
実株価より、大幅に、増加状態で、
売りとなります。
美しいグラフとなり、
永遠なる右肩上がりになります。
訂正箇所を、お教え願えませんでしょうか。
---------------------------
#include <TIlib>

def Num(price)
	num = 1000000/price
	if num >= 1000
		num = (num/1000)*1000
	elsif num >= 100
		num = (num/100)*100
	elsif num == 0
		num = 1
	end
	return num
end

if !$__INIT__
	$RCI_fast = RCI_new(15)
	$RCI_slow = RCI_new(25)
	$Cross = Crossover_new(0, 0.0)
	$__INIT__ = 1
else
	RCI_next($RCI_fast)
	RCI_next($RCI_slow)
end

rci_fast = RCI_value($RCI_fast)
rci_slow = RCI_value($RCI_slow)
price = {+1}Open
if !price
	price = Close
end

if rci_fast == null || rci_slow == null || !price
else
	cross = Crossover_next($Cross, rci_fast, rci_slow)
	if !$long && cross > 0 && Close > 50 && Volume * Close >
10000
		$long = Num(price)
		Buy(price, $long)
		$loss_cut = Yobine(price * 0.75)
	elsif $long
		if Low > 0 && Low <= $loss_cut
			Sell(Min($loss_cut, Open), $long)
			$long = 0
		elsif cross < 0
			Sell(price, $long)
			$long = 0
		end
	end
end

// Local Variables:
// tab-width: 4
// End:
----------------------------------------




Protra-users メーリングリストの案内
Back to archive index