//+------------------------------------------------------------------+ //| Timer function | //+------------------------------------------------------------------+ void OnTimer() { OnTick(); }
Marco vd Heijden:
It's really a good idea.
I wrote OnCalculation in OnTimer too.
void OnTimer() { //--- datetime arrTime[]; double arrOpen[],arrHigh[],arrLow[],arrClose[]; long arrTickVolume[],arrVolume[]; int arrSpread[]; ArrayCopy(arrTime,Time,0,0,WHOLE_ARRAY); ArrayCopy(arrOpen,Open,0,0,WHOLE_ARRAY); ArrayCopy(arrHigh,High,0,0,WHOLE_ARRAY); ArrayCopy(arrLow,Low,0,0,WHOLE_ARRAY); ArrayCopy(arrClose,Close,0,0,WHOLE_ARRAY); ArrayCopy(arrVolume,Volume,0,0,WHOLE_ARRAY); CopyTickVolume(Symbol(),0,0,Bars-1,arrTickVolume); CopySpread(Symbol(),0,0,Bars-1,arrSpread); OnCalculate(Bars,0,arrTime,arrOpen,arrHigh,arrLow,arrClose,arrTickVolume,arrVolume,arrSpread); }

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am really busy on the trading day.
So could only code some script on Saturday and Sunday.
Then I found there is no sigle come in.OnCalculate and OnTick could only draw indicator on histroy data.
Could any one know how to test Indicator script on Sunday?