http://www.yassersoft.com/?menu=CFORUM_VIEW_ARTICLE&fid=2&sid=2185
Wealth-Lab 產生指令檔程式碼範例
在主程式的 for 迴圈當中,加上
if (Bar = BarCount-1) then
begin
var sFile : String;
sFile := IntToStr(GetYear(Bar)) + '/' + IntToStr(GetMOnth(Bar)) + '/' + IntToStr(GetDay(Bar))+ ' ' + IntToStr(GetHour(Bar))+':'+IntToStr(GetMinute(Bar))+' '+IntToStr(marketposition)+' '+FloatToStr(PriceClose(Bar))+Chr(13)+Chr(10);
FileWrite(FileCreate('C:\cur_cmd.txt'),sFile);
end
其中PriceClose(Bar)回傳的值不是精準的整數,晚點想辦法。
2010年2月17日 星期三
輸出訊號
2010年2月11日 星期四
2010年2月9日 星期二
2010年2月6日 星期六
2010年2月4日 星期四
2010年2月2日 星期二
2010年1月29日 星期五
2010年1月25日 星期一
停損在 this bar
有個指令可以讓你使用停損在 this bar,那就是 BarsSinceEntry,
0為進場點,進場點為第一根,大於零表示從進場後第二根起算。
例子:
IF Close < EntryPrice(0)-10 AND BarsSinceEntry(0) > 0 THEN
ExitLong this bar at market
END IF
正確的停損(HTS版)
If marketposition = 1 then
exitlong at XXX stop
end if
if marketposition = -1 then
exitshort at XXX stop
end if
訂閱:
文章 (Atom)