- How to code?
- EMA crossover signal arrow on the current candle
- "DDFX" trade system
Rosh: See values of an indicator on first tick of new bar.
Transliteration: When the first tick of the new day comes, make your decision based on the last bar of the old day.
"I want it to calculate EMA only on today's close"
To be precise, there is no "close" for today, only the current price
"so if "buy" or "sell" signal occured, it trades by tomorrow's open"
Tomorrow isn't here yet.
What you should be saying, and programming is this:
"I want to calculate EMA on yesterday's close, so if "buy" or "sell" signal occurred, it trades by today's open. Please help"
Ok, here is the rest of the help
int dayNumber; int init(){ dayNumber = TimeDayOfYear(Time[0]); } int start(){ if(dayNumber != TimeDayOfYear(Time[0])){ dayNumber = TimeDayOfYear(Time[0]); // first tick of new day is detected // do your calculation and make your decision based on indicator value calculated for yesterday's close
Rosh: See values of an indicator on first tick of new bar.
Transliteration: When the first tick of the new day comes, make your decision based on the last bar of the old day.
"I want it to calculate EMA only on today's close"
To be precise, there is no "close" for today, only the current price
"so if "buy" or "sell" signal occured, it trades by tomorrow's open"
Tomorrow isn't here yet.
What you should be saying, and programming is this:
"I want to calculate EMA on yesterday's close, so if "buy" or "sell" signal occurred, it trades by today's open. Please help"
Ok, here is the rest of the help
int dayNumber; int init(){ dayNumber = TimeDayOfYear(Time[0]); } int start(){ if(dayNumber != TimeDayOfYear(Time[0])){ dayNumber = TimeDayOfYear(Time[0]); // first tick of new day is detected // do your calculation and make your decision based on indicator value calculated for yesterday's close
I tried, it doesn't work. But it's okay, I have other solution in mind instead of EA trade on the open of the next bar. Will you please check it out.
Thanks again.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use