トレードステーションEasyLanguageで、呼び値を取得する

呼び値

トレードステーションEasyLanguageで、呼び値を取得したい!という時のための記事です。

自動売買プログラムを書いている時、「呼び値」、つまり株価の動く幅を取得したいときがあります。と言うより、呼び値を考慮に入れていないと問題になることがあります。

例えば、非TOPIX100銘柄のとき、株価が5,000円〜30,000円の時の呼び値は5円です。なので、このようなコードはどういう挙動を示すか分かりません。

Buy next bar at 5,001 limit (5,001円指値で買う)

5,001円という値は存在しないわけですから、どうなることやら、、こんな時の為に、呼び値を取得するコードを探してみました。

呼び値を取得したい

リファレンスを見てみても、どうやら呼び値を直接取得する予約語は見つかりませんでした。(Minmove、Pricescale、Pointvalue等のそれらしき予約語はありますが、、);

ですが、どうやら予約語Pricescaleは、TOPIX100銘柄の時に10を返し、それ以外のときには1を返すようです。なので、このようなコードで一応呼び値を返せます。

var: yobine(0);

If PriceScale = 10 then begin
	yobine = 10000;
	If close < 50000000 then yobine = 10000;
	If close < 30000000 then yobine = 5000;
	If close < 10000000 then yobine = 1000;
	If close < 3000000 then yobine = 500;
	If close < 1000000 then yobine = 100;
	If close < 300000 then yobine = 50;
	If close < 100000 then yobine = 10;
	If close < 30000 then yobine = 5;
	if close < 10000 then yobine = 1;
	if close < 3000 then yobine = 0.5;
	if close < 1000 then yobine = 0.1;	
end
Else begin
	yobine = 100000;
	If close < 50000000 then yobine = 50000;
	If close < 30000000 then yobine = 10000;
	If close < 5000000 then yobine = 5000;
	If close < 3000000 then yobine = 1000;
	If close < 500000 then yobine = 500;
	If close < 300000 then yobine = 100;
	If close < 50000 then yobine = 50;
	If close < 30000 then yobine = 10;
	if close < 5000 then yobine = 5;
	if close < 3000 then yobine = 1;
end;

呼び値の定義に従って呼び値を計算しています。

もし呼び値をもっと簡単に正しく取得できる方法をご存じの方はぜひお知らせ下さい!

 

トレードステーションで自動売買を行うには、こちらの記事もご参考下さい。

トレードステーションで株の自動売買を始めるために

EasyLanguage

Posted by auto-ts.net