免費論壇 繁體 | 簡體
公告:SCLUB雲端專屬主機己開放租用
分享
MT4程式(Program)專業代寫服務(請email:letgofortrading@gmail.com) 警告:文章內容可能有大便,不喜請勿入。請不要像動物一樣,不歡迎也請勿自行進來找碴和找大便。私人網頁,後果請自行負責~
返回列表 發帖

AFL掃描AB數據

實時Tick數據通過real time feed保存到AB中,如何用AFL自動把Tick數據規整成1分鐘HLOC和5分鐘HLOC數據,AB的Charting裡面可以選擇1,5,15,30分鐘


小弟是用這個 AFL 參考看看

/*
Export intraday and EOD data to TXT files
One file for each stock
In the first line insert the directory you want to save them to, make sure the
directory exists
Select your charts to export with the "Apply to" filter in AA window
Select the timeframe period you want to save as using the AA "Settings"
Press Scan button
by Graham Kavanagh 05 Feb 2004
*/

fh = fopen( "c://RPT/"+Name()+".txt", "w");
if( fh )
{
   fputs( "Date,Time,Open,High,Low,Close,Volume \n", fh );
   y = Year();
   m = Month();
   d = Day();
   r = Hour();
   e = Minute();
   n = Second();

   for( i = 0; i < BarCount; i++ )
   {
      //fputs( Name() + "," , fh );
      ds = StrFormat("%02.0f-%02.0f-%02.0f,",
                     y[ i ], m[ i ], d[ i ] );
      fputs( ds, fh );

      ts = StrFormat("%02.0f:%02.0f:%02.0f,",
                     r[ i ],e[ i ],n[ i ] );
      fputs( ts, fh );

      qs = StrFormat("%.4f,%.4f,%.4f,%.4f,%.0f\n",
                     O[ i ],H[ i ],L[ i ],C[ i ],V[ i ] );
      fputs( qs, fh );
   }

   fclose( fh );
}

Buy = 1;



If you wanna convert tickdata to other intervals and wanna keep it in the AmiBroker database then you don't need to export the data. You may use AddToComposite to convert tickdata into other intervals. It is much faster than export of data and re-importing it again.

Secondly you are not limited to 1,5,15,30 intervals. You can customize any other interval. Besides in the toolbar you can insert any interval to be charted.

In backtester you have to go to backtest settings > periodicity. In order to make custom interval being visible there you have to define those custom intervals in Tools - Preferences - Intraday.

Chart time frame and analysis time frame settings are independent from each other!
But both are dependent on File - Database settings - Base time interval!
!qqconnect:connect_viewthread_share_title!: !qqconnect:connect_viewthread_share_to_qzone!!qqconnect:connect_viewthread_share_to_qzone! !qqconnect:connect_viewthread_share_to_weibo!!qqconnect:connect_viewthread_share_to_weibo! !qqconnect:connect_viewthread_share_to_pengyou!!qqconnect:connect_viewthread_share_to_pengyou!
LMAX 顛覆外匯交易經驗/擊敗所有外匯經紀商

返回列表