COCO研究院

 找回密碼
 註冊
搜索
樓主: GnuHomot

Amibroker接下單大師測試

[複製鏈接]
 樓主| 發表於 11-7-28 10:04 | 顯示全部樓層
我轉換時間字串的函數寫錯了
now(4)回傳的是數字,我以為是字串=___=
 樓主| 發表於 11-7-28 10:06 | 顯示全部樓層
貼上修改過的function。太菜了,居然會犯這種錯

  1. function newDateTimeStr()
  2. {

  3.         newNowDateTime=Now(0);

  4.         sYear=StrLeft(Now(1),4);
  5.         //_TRACE("sYear: "+sYear);

  6.         sDate=StrRight(Now(1),StrLen(Now(1))-5);
  7.         //_TRACE("sDate: "+sDate);

  8.         iMonth=StrToNum(sDate);
  9.         if(iMonth<10)
  10.         sMonth="0"+NumToStr(iMonth,1.0);
  11.         else
  12.         sMonth=NumToStr(iMonth,1.0);
  13.         //_TRACE("sMonth: "+sMonth);


  14.         if(iMonth<10)
  15.         sDay=StrMid(sDate,2,2);
  16.         else
  17.         sDay=StrMid(sDate,3,2);

  18.         iDay=StrToNum(sDay);
  19.         if(iDay<10)
  20.         sDay="0"+NumToStr(iDay,1.0);
  21.         else
  22.         sDay=NumToStr(iDay,1.0);
  23.         //_TRACE("sDay: "+sDay);

  24.         sTime=StrFormat("%g",Now(4));
  25.         if(StrLen(sTime)<6)
  26.         sTime="0"+sTime;
  27.         
  28. newNowDateTime=sYear+"/"+sMonth+"/"+sDay+" "+sTime;
  29. //_TRACE("newNowDateTime: "+newNowDateTime);

  30. return newNowDateTime;
  31. }
複製代碼
 樓主| 發表於 11-8-1 19:48 | 顯示全部樓層
繼續來報告這幾天測試的結果

一樣是參考ashell兄的範例http://coco-in.net/viewthread.php?tid=6771&extra=page%3D2

不過其中有幾個是我已知的問題:
1.OMComAPI.GoOrder("FTX","","NowDateTime",Nowposition,Nowclose);
其中"NowDateTime"應該要改為NowDateTime,因為這樣子是輸出一個叫做NowDateTime的字串,而不是真正的時間字串。
2.當下的K棒在接收資料的時候其實是不斷的變動,如果你是檢查最後一根K棒來決定要不要進出,會發現訊號會不斷的送出。譬如說如果是黃金交叉買進的策略,在1分K的圖上面,有可能會出現12:00:01時因為出現交叉向上而送出訊號,但是12:00:05過後,因為下跌又沒有交叉了,所以最後的結果你是看不到這個交叉訊號的,但是下單大師已經收到你的買訊。
所以這邊我改成檢查倒數第二根K棒來決定是否要進場。

3.因為一旦AB跟下單大師都關掉的話,GetNowPosition()也無法問到目前的倉位,所以必需要把倉位記錄起來存在硬碟,這裡是參考http://www.amibroker.org/userkb/2007/04/24/persistent-variables/

4.原先ashell兄是用if (Buy[BarCount-1]==True)來檢查是否進場,但我發現有時候我居然滾動視窗都會觸發訊號,讓我對BarCount這個值非常懷疑,所以我參考http://www.amibroker.com/at/,改成用LastValue去做。

5.最後一個問題,也是打擊我最大的問題就是,我這樣子做的方向是錯的


這樣子寫出來的程式碼,是利用Chart更新(預設是每秒更新一次)來檢查是否有產生訊號,但是前提是你必需該Chart要打開XDDD
也就是說如果你切換到別的Sheet就不會有作用了。


後來我才查到應該用AA中run every XXX time的作法來做才對,http://www.coco-in.net/viewthread.php?tid=1446&extra=,這部份就以後再說了


總而言之,如果願意讓視窗保持完全不動的情況下,那麼我這個程式碼已經是可以發出正確的訊號,但是記得下單大師那邊一定要設定成用Current類的訊號,不然...後果可能很嚴重。


這是我今天測試的結果,http://imm.io/7Ldr
圖上的訊號在下單大師都有正確的接收到。

接下來要來研發策略了。
 樓主| 發表於 11-8-1 19:51 | 顯示全部樓層
請參考。

  1. function newDateTimeStr()
  2. {
  3.         newNowDateTime=Now(0);

  4.         sYear=StrLeft(Now(1),4);
  5.         //_TRACE("sYear: "+sYear);

  6.         sDate=StrRight(Now(1),StrLen(Now(1))-5);
  7.         //_TRACE("sDate: "+sDate);

  8.         iMonth=StrToNum(sDate);
  9.         if(iMonth<10)
  10.         sMonth="0"+NumToStr(iMonth,1.0);
  11.         else
  12.         sMonth=NumToStr(iMonth,1.0);
  13.         //_TRACE("sMonth: "+sMonth);


  14.         if(iMonth<10)
  15.         sDay=StrMid(sDate,2,2);
  16.         else
  17.         sDay=StrMid(sDate,3,2);

  18.         iDay=StrToNum(sDay);
  19.         if(iDay<10)
  20.         sDay="0"+NumToStr(iDay,1.0);
  21.         else
  22.         sDay=NumToStr(iDay,1.0);
  23.         //_TRACE("sDay: "+sDay);

  24.         sTime=StrFormat("%g",Now(4));
  25.         if(StrLen(sTime)<6)
  26.         sTime="0"+sTime;

  27. newNowDateTime=sYear+"/"+sMonth+"/"+sDay+" "+sTime;
  28. //_TRACE("newNowDateTime: "+newNowDateTime);

  29. return newNowDateTime;
  30. }
  31. //***********************************************//

  32. function PersistentVarSet( VarName, Number )
  33. {
  34. global PersistentPath;
  35. String = NumToStr(Number);
  36. fh = fopen( PersistentPath+VarName+".pva","w" );
  37. if( fh )
  38. {
  39. fputs( String, fh );
  40. fclose( fh );
  41. }
  42. return fh;
  43. }

  44. function PersistentVarGet( VarName )
  45. {
  46. global PersistentPath;
  47. fh = fopen( PersistentPath+VarName+".pva","r" );
  48. if( fh )
  49. {
  50. String = fgets( fh );
  51. fclose( fh );
  52. Number = StrToNum(String);
  53. }
  54. else Number = Null;
  55. return Number;
  56. }

  57. //***********************************************//
  58. //The Above are Functions

  59. PersistentPath =ParamStr("Save Path","C:\\AB_PVA\");//must create folder first, or "fopen" will return false.
  60. IDstr=ParamStr("ID String","ABTW");

  61. SMA=Param("SMA", 3, 2, 20);
  62. LMA=Param("LMA", 10, 10, 200);

  63. OMComAPI = CreateStaticObject("OMSignAPI.OMCOMAPI");
  64. NowPostion=0;
  65. NowPosition=OMComAPI.GetNowPosition(IDstr);
  66. if(NowPosition>99990)
  67. {
  68. if(PersistentVarGet( IDstr )==Null)
  69. {
  70. NowPosition=0;
  71. PersistentVarSet(IDstr, NowPosition);
  72. }
  73. else
  74. {
  75.   NowPosition=PersistentVarGet( IDstr );
  76.   //PersistentVarSet(IDstr, NowPosition);
  77.   _TRACE("Get Persistent Var First Call: "+IDstr);
  78. }
  79. }
  80. //_TRACE(PersistentPath);
  81. //_TRACE("NowPosition: "+NumToStr(NowPosition));

  82. OMComAPI.IniDllAndPosition(IDstr, NowPosition);

  83. //stradegy here
  84. up=Cross(MA(C,SMA),MA(C,LMA));
  85. down=Cross(MA(C,LMA),MA(C,SMA));
  86. Buy = up;
  87. Sell = down OR TimeNum()>134000;//force to exit after 13:40:00
  88. Buy =ExRem(Buy,Sell);
  89. Sell=ExRem(Sell,Buy);

  90. //if(NowPosition<1) //avoid repeat buy at every updating chart
  91. if (LastValue(Ref(Buy,-1)) )
  92. {
  93. NowDateTime=newDateTimeStr();
  94. NowPosition = 1;
  95. NowClose=LastValue(Ref(Close,-1));//LastValue(Close);
  96. OMComAPI.GoOrder(IDstr,"",NowDateTime,Nowposition,Nowclose);
  97. _TRACE("Buy"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime);
  98. PersistentVarSet(IDstr, NowPosition);
  99. }

  100. //if(NowPosition>0)
  101. if (LastValue(Ref(Sell,-1)) )
  102. {
  103. NowDateTime=newDateTimeStr();
  104. NowPosition = 0;
  105. NowClose=LastValue(Ref(Close,-1));//LastValue(Close);
  106. OMComAPI.GoOrder(IDstr,"",NowDateTime,NowPosition,NowClose);
  107. _TRACE("Sell"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime);
  108. PersistentVarSet(IDstr, NowPosition);
  109. }

  110. Plot(MA(C,SMA),"SMA"+NumToStr(SMA,1.0),colorRed,styleLine);
  111. Plot(MA(C,LMA),"LMA"+NumToStr(LMA,1.0),colorBlue,styleLine);
  112. //PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone) ,colorYellow, 0,L,-50);
  113. //PlotShapes(IIf( Sell, shapeSmallDownTriangle, shapeNone) ,colorBlue, 0,H,-45);
  114. PlotShapes(Buy * shapeSmallUpTriangle ,colorRed, 0,L,-50);
  115. PlotShapes(Sell * shapeSmallDownTriangle ,colorGreen, 0,H,-45);

  116. dist=1.5*ATR(10);
  117. for( i = 1; i < BarCount; i++ )
  118. {
  119. if( Buy[i-1] ) PlotText( "Buy\n@" + C[ i-1 ], i, L[ i ]-dist[i], colorRed );
  120. if( Sell[i-1] ) PlotText( "Sell\n@" + C[ i-1 ], i, H[ i ]+dist[i], colorGreen );
  121. }


  122. _SECTION_BEGIN("Price1");
  123. SetChartOptions(0,chartShowArrows|chartShowDates);
  124. _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
  125. Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
  126. _SECTION_END();
複製代碼

評分

參與人數 1金錢 +2 收起 理由
lwhuang + 2 感謝分享

查看全部評分

發表於 11-8-1 20:17 | 顯示全部樓層
HI 大大

請問您用下單大師萬用API

和文字檔下單,感覺上,下單速度會差很多嗎

感謝
 樓主| 發表於 11-8-1 20:50 | 顯示全部樓層
我不是大大
我目前只有測試到下單大師的模擬單而已,還沒實測過。
我也只有試過萬用API,我看AB輸出的訊號時間到下單大師接收時間,幾乎都在同一秒內,我想這樣子應該已經夠快了吧??
發表於 11-8-1 21:25 | 顯示全部樓層
我不是大大。
我目前只有測試到下單大師的模擬單而已,還沒實測過。
我也只有試過萬用API,我看AB ...
GnuHomot 發表於 11-8-1 08:50 PM


好像不ˊ賴
 樓主| 發表於 11-8-3 20:53 | 顯示全部樓層
繼續來報告,參考這篇的作法
http://www.coco-in.net/viewthread.php?tid=1446&extra=

發現要改其實沒那麼難,主要就是利用
if  ( Status("action") == actionScan  )
來判斷是否有滿足發動下單條件。

而在Automatic Analysis中
把預設5min改為1sec(視個人需求),將Run Every打勾,按下Scan。
如此一來Amibroker就會以一秒Scan一次去檢查,目前的商品是否有滿足下單條件。

這樣的作法跟之前比起來,最大的差別有兩個:
1.不用停留在視窗上,就算切換視窗也沒問題,訊號一樣會發出。
2.可以選擇多商品來交易,達成[單一策略多商品交易]的目的。

另外我又參考
http://www.amibroker.com/guide/h_alerts.html
設定滿足條件時,由Amibroker發出Alert。
如此一來,當Amibroker要送出訊號時,會寄一封信到Gmail,而下單大師收到訊號時,同時也會寄一封信到Gmail。

信箱就可以收到這樣的信
http://imm.io/7QnZ
第一封是Amibroker第一次啟動Scan時所通知,就可以知道Amibroker啟動了。
第二封是Scan到滿足下單條件由Amibroker送出,第三封是下單大師收到訊號後寄的。

整個要自動化下單的架構應該就是這樣了。

希望有遺漏的地方請前輩多多指教。
 樓主| 發表於 11-8-3 20:54 | 顯示全部樓層
  1. function newDateTimeStr()
  2. {
  3.         newNowDateTime=Now(0);

  4.         sYear=StrLeft(Now(1),4);
  5.         //_TRACE("sYear: "+sYear);

  6.         sDate=StrRight(Now(1),StrLen(Now(1))-5);
  7.         //_TRACE("sDate: "+sDate);

  8.         iMonth=StrToNum(sDate);
  9.         if(iMonth<10)
  10.         sMonth="0"+NumToStr(iMonth,1.0);
  11.         else
  12.         sMonth=NumToStr(iMonth,1.0);
  13.         //_TRACE("sMonth: "+sMonth);


  14.         if(iMonth<10)
  15.         sDay=StrMid(sDate,2,2);
  16.         else
  17.         sDay=StrMid(sDate,3,2);

  18.         iDay=StrToNum(sDay);
  19.         if(iDay<10)
  20.         sDay="0"+NumToStr(iDay,1.0);
  21.         else
  22.         sDay=NumToStr(iDay,1.0);
  23.         //_TRACE("sDay: "+sDay);

  24.         sTime=StrFormat("%g",Now(4));
  25.         if(StrLen(sTime)<6)
  26.         sTime="0"+sTime;

  27. newNowDateTime=sYear+"/"+sMonth+"/"+sDay+" "+sTime;
  28. //_TRACE("newNowDateTime: "+newNowDateTime);

  29. return newNowDateTime;
  30. }
  31. //***********************************************//

  32. function PersistentVarSet( VarName, Number )
  33. {
  34. global PersistentPath;
  35. String = NumToStr(Number);
  36. fh = fopen( PersistentPath+VarName+".pva","w" );
  37. if( fh )
  38. {
  39. fputs( String, fh );
  40. fclose( fh );
  41. }
  42. return fh;
  43. }

  44. function PersistentVarGet( VarName )
  45. {
  46. global PersistentPath;
  47. fh = fopen( PersistentPath+VarName+".pva","r" );
  48. if( fh )
  49. {
  50. String = fgets( fh );
  51. fclose( fh );
  52. Number = StrToNum(String);
  53. }
  54. else Number = Null;
  55. return Number;
  56. }

  57. //***********************************************//
  58. //The Above are Functions

  59. PersistentPath =ParamStr("Save Path","C:\\AB_PVA\");//must create folder first, or "fopen" will return false.
  60. IDstr=ParamStr("ID String","ABTW");

  61. SMA=Param("SMA", 3, 2, 20);
  62. LMA=Param("LMA", 10, 10, 200);

  63. if  ( Status("action") == actionScan  )
  64. {
  65. //_TRACE("actionScan");
  66. OMComAPI = CreateStaticObject("OMSignAPI.OMCOMAPI");
  67. NowPostion=0;
  68. NowPosition=OMComAPI.GetNowPosition(IDstr);
  69. if(NowPosition>99990)
  70. {
  71. if(PersistentVarGet( IDstr )==Null)
  72. {
  73. NowPosition=0;
  74. PersistentVarSet(IDstr, NowPosition);
  75. _TRACE("Can't Get Persistent Var then Create: "+IDstr);

  76. }
  77. else
  78. {
  79.   NowPosition=PersistentVarGet( IDstr );
  80.   //PersistentVarSet(IDstr, NowPosition);
  81.   _TRACE("Get Persistent Var First Call: "+IDstr);
  82. }
  83. OMComAPI.IniDllAndPosition(IDstr, NowPosition);
  84. AlertIf(1,"EMAIL", "OrderMaster Initialized: "+NumToStr(NowPosition,1.0), 0);
  85. }
  86. //_TRACE(PersistentPath);
  87. //_TRACE("NowPosition: "+NumToStr(NowPosition));

  88. }//if  ( Status("action") == actionScan  )


  89. //stradegy here
  90. up=Cross(MA(C,SMA),MA(C,LMA));
  91. down=Cross(MA(C,LMA),MA(C,SMA));
  92. Buy = up;
  93. Sell = down OR TimeNum()>133900;//force to exit after 13:40:00
  94. Buy =ExRem(Buy,Sell);
  95. Sell=ExRem(Sell,Buy);


  96. if  ( Status("action") == actionScan  )
  97. {

  98. if(NowPosition<1) //avoid repeat buy at every updating chart
  99. if (LastValue(Ref(Buy,-1)) )
  100. {
  101. NowDateTime=newDateTimeStr();
  102. NowPosition = 1;
  103. NowClose=LastValue(Ref(Close,-1));//LastValue(Close);
  104. OMComAPI.GoOrder(IDstr,"",NowDateTime,Nowposition,Nowclose);
  105. _TRACE("Buy"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime);
  106. AlertIf(1,"EMAIL", "Buy"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime, 1);
  107. PersistentVarSet(IDstr, NowPosition);
  108. }

  109. if(NowPosition>0)
  110. if (LastValue(Ref(Sell,-1)) )
  111. {
  112. NowDateTime=newDateTimeStr();
  113. NowPosition = 0;
  114. NowClose=LastValue(Ref(Close,-1));//LastValue(Close);
  115. OMComAPI.GoOrder(IDstr,"",NowDateTime,NowPosition,NowClose);
  116. _TRACE("Sell"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime);
  117. AlertIf(1,"EMAIL", "Sell"+NumToStr(NowPosition,1.0)+"@"+NumToStr(Nowclose,1.0)+"@"+NowDateTime, 2);
  118. PersistentVarSet(IDstr, NowPosition);
  119. }

  120. }//if  ( Status("action") == actionScan  )


  121. Plot(MA(C,SMA),"SMA"+NumToStr(SMA,1.0),colorRed,styleLine);
  122. Plot(MA(C,LMA),"LMA"+NumToStr(LMA,1.0),colorBlue,styleLine);
  123. //PlotShapes(IIf(Buy , shapeSmallUpTriangle, shapeNone) ,colorYellow, 0,L,-50);
  124. //PlotShapes(IIf( Sell, shapeSmallDownTriangle, shapeNone) ,colorBlue, 0,H,-45);
  125. PlotShapes(Buy * shapeSmallUpTriangle ,colorRed, 0,L,-50);
  126. PlotShapes(Sell * shapeSmallDownTriangle ,colorGreen, 0,H,-45);

  127. dist=1.5*ATR(10);
  128. for( i = 1; i < BarCount; i++ )
  129. {
  130. if( Buy[i-1] ) PlotText( "Buy\n@" + C[ i-1 ], i, L[ i ]-dist[i], colorRed );
  131. if( Sell[i-1] ) PlotText( "Sell\n@" + C[ i-1 ], i, H[ i ]+dist[i], colorGreen );
  132. }


  133. _SECTION_BEGIN("Price1");
  134. SetChartOptions(0,chartShowArrows|chartShowDates);
  135. _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} Open %g, Hi %g, Lo %g, Close %g (%.1f%%) {{VALUES}}", O, H, L, C, SelectedValue( ROC( C, 1 ) ) ));
  136. Plot( C, "Close", ParamColor("Color", colorBlack ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() );
  137. _SECTION_END();
複製代碼
 樓主| 發表於 11-8-3 20:56 | 顯示全部樓層
不知道有沒有前輩知道要如何做多策略??

難不成要把所有策略都寫到同一個AFL裡面,有點怪怪的
 樓主| 發表於 11-8-3 21:18 | 顯示全部樓層
順便說明一下我目前規劃的流程
1.Run DDE2TickQuote.exe (ABTW)
2.Run Amibroker
3.Automatic Analysis => Run Every => Scan
4.Run OrderMaster下單大師 =>開始下單

附上很簡陃的AutoIt的程式碼,小弟只是AutoIt的初學者,有錯請前輩多多指教。
接下來可以利用Windows的工作排程器,排定每天早上8:45去執行AutoIt編譯好的執行檔做這些動作。

收盤後再利用下單大師的關機流程把這些程式都關掉,和把電腦關閉。





  1. #cs ----------------------------------------------------------------------------

  2. AutoIt Version: 3.3.6.1
  3. Author:         GnuHomot

  4. Script Function:
  5.         Template AutoIt script.

  6. #ce ----------------------------------------------------------------------------

  7. ; Script Start - Add your code below here

  8. ShellExecute("C:\ABTW\DDE2TickQuote.exe", "-auto","C:\ABTW")
  9. ;run("C:\ABTW\DDE2TickQuote.exe","C:\ABTW")
  10. WinWait("DDE2TickQuote")

  11. ControlClick("Note","", "[CLASSNN:Button1]")

  12. WinActivate("DDE2TickQuote")
  13. WinWaitActive("DDE2TickQuote","", 5)

  14. ;enter password
  15. WinWait("群益DLL連線設定")
  16. ControlClick("群益DLL連線設定","", 1)

  17. Sleep(3000);

  18. ;;close Form
  19. ;WinActivate("DDE2TickQuote")
  20. ;WinWaitActive("DDE2TickQuote")
  21. ;ControlClick("DDE2TickQuote","", 2)


  22. run("C:\Program Files (x86)\AmiBroker\Broker.exe","C:\Program Files (x86)\AmiBroker")
  23. WinWait("[CLASS:AmiBrokerMainFrameClass]","",5)

  24. Sleep(15000);//wait for ABTW loading data into Amibroker

  25. WinActivate("Note")
  26. ;WinWaitActive("Note")
  27. ControlClick("Note","", "[CLASSNN:Button1]")

  28. ;Run AA every run in 1sec
  29. WinMinimizeAll()
  30. WinSetState("[CLASS:AmiBrokerMainFrameClass]","",@SW_MAXIMIZE)
  31. WinActivate("[CLASS:AmiBrokerMainFrameClass]")
  32. $rtn=WinWaitActive("[CLASS:AmiBrokerMainFrameClass]","", 5)
  33. Send("^q");go Amibroker to set customize hot-key to call "Automatic Analysis"
  34. WinWaitActive("[CLASS:#32770]","",5)
  35. ControlSend("[CLASS:#32770]","", "[CLASSNN:Edit2]", "^a")
  36. ControlSend("[CLASS:#32770]","", "[CLASSNN:Edit2]", "1sec")
  37. ControlCommand("[CLASS:#32770]","", "[CLASSNN:Button18]", "Check")
  38. ControlClick("[CLASS:#32770]","", "[CLASSNN:Button3]")


  39. ;Run OrderMaster
  40. run("C:\Program Files (x86)\OrderMaster\OrderMaster.exe","C:\Program Files (x86)\OrderMaster")

  41. WinWait("[CLASS:WindowsForms10.Window.8.app.0.378734a]")
  42. ;WinActivate("[CLASS:WindowsForms10.Window.8.app.0.378734a]")
  43. ;WinWaitActive("[CLASS:WindowsForms10.Window.8.app.0.378734a]")
  44. Sleep(10000);
  45. ControlClick("[CLASS:WindowsForms10.Window.8.app.0.378734a]","", "[CLASSNN:WindowsForms10.BUTTON.app.0.378734a5]")
  46. ;MouseClick("left", 1366, 345)


  47. Exit
複製代碼
發表於 11-8-3 21:47 | 顯示全部樓層
順便說明一下我目前規劃的流程
1.Run DDE2TickQuote.exe (ABTW)
2.Run Amibroker
3.Automatic Analysis =>  ...
GnuHomot 發表於 11-8-3 09:18 PM


大大 請問 autoit 要怎麼寫

開啟 amiBroker 之後


進入 file -> import wizard

pick files -> (進入我指定的目錄之後,選擇我指定的數個檔案)

自動選好格式  YMD, time  底下選 comma or space

---
這個對我來說好難阿
發表於 11-8-3 21:55 | 顯示全部樓層
另外我又參考
http://www.amibroker.com/guide/h_alerts.html
設定滿足條件時,由Amibroker發出Alert。
GnuHomot 發表於 11-8-3 08:53 PM


   這個厲害~ 小弟還沒玩過
 樓主| 發表於 11-8-3 22:00 | 顯示全部樓層
大大 請問 autoit 要怎麼寫

開啟 amiBroker 之後


進入 file -> import wizard

pick files -> (進 ...
kilroy 發表於 11-8-3 09:47 PM


沒寫過,不會
 樓主| 發表於 11-8-4 10:01 | 顯示全部樓層
本帖最後由 GnuHomot 於 11-8-4 10:03 AM 編輯

沒想到這麼快又來要報告了,因為我發現bug

原來程式中
if(PersistentVarGet( IDstr )==Null)
這個條件式是無用的>"<
因為雖然PersistentVarGet()會回傳Null,但是就是沒辦法跟Null做比較,我也不知道為什麼。

這行要改成
if(NumtoStr(PersistentVarGet(IDstr) == {EMPTY})
利用NumtoStr轉Null後會變成"{EMPTY}"字串來做比較

這樣子就可以了

另外
單一策略多商品交易確定這個方法也行
程式碼稍微修改後,不同商品發出不同的辨識碼給下單大師,下單大師那邊也同時設定好,在AA中選All Symbols就可以了。
我在網路上還是沒找到要怎麼做自動交易 多策略單一商品 或是多策略多商品的方法
您需要登錄後才可以回帖 登錄 | 註冊

本版積分規則

手機版|Archiver|站長信箱|廣告洽詢|COCO研究院

GMT+8, 24-5-18 21:07

Powered by Discuz! X3.4

Copyright © 2001-2023, Tencent Cloud.

快速回復 返回頂部 返回列表
理財討論網站 | AI繪圖AI超擬真美女AI beauty AI Stable DiffusionAI正妹AI Lookbook