- Code fails if Period() is not TimeFrame1
int iTF1 = iBarShift(Symbol(),TimeFrame1,Time[i]), iTF2 = iBarShift(Symbol(),TimeFrame2,Time[i]); FastMAValueTF1=iMA(Symbol(),TimeFrame1,FastMA,0,MODE_EMA,PRICE_CLOSE,i); SlowMAValueTF1=iMA(Symbol(),TimeFrame1,SlowMA,0,MODE_EMA,PRICE_CLOSE,i); PrevFastMAValueTF1=iMA(Symbol(),TimeFrame1,FastMA,0,MODE_EMA,PRICE_CLOSE,i+1); PrevSlowMAValueTF1=iMA(Symbol(),TimeFrame1,SlowMA,0,MODE_EMA,PRICE_CLOSE,i+1); //Stoch Points one tf StochValueTF1=iStochastic(Symbol(),TimeFrame1,5,3,2,MODE_SMA,0,0,i); PrevStochValueTF1=iStochastic(Symbol(),TimeFrame1,5,3,2,MODE_SMA,0,0,i+1); //=========================================================================
- Your lines are irrelevant. They are moving averages of the chart's timeframe, not TimeFrame1/2.
WHRoeder:
- Code fails if Period() is not TimeFrame1
- Your lines are irrelevant. They are moving averages of the chart's timeframe, not TimeFrame1/2.
1) Thank you --- I realize that. As I get more proficient I will try to solve that issue. For the time being Period(0) and TimeFrame1 will be the same.
2) Since the lines are irrelevant, is it your opinion that the code is working properly? Each of the arrows in my screen shot are correct?? I notice that the journal ma points do not coincide with the lines. Why are the two calculations so different?
You have been very helpful to me and I really appreciate it.
Thanks again.
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