How can a bars in calculation be set by a user input as well as all bars so that it doesn't count all bars each time?
Example, we have an input for bars in calculation which if set for 0 meant to calculate all bars.
I think I have the right idea using IndicatorCounted() ..
First tick says 1000 and every tick thereafter says 0 ..
How do you use the latest standard??
What does your function IndicatorCounted() do?
What does your function IndicatorCounted() do?
rates_total-1-prev_calculated always equals rates_total-1. prev_calculated always equals 0 and IndicatorCounted() equals bars and then equals 0 so what gives? How is this even right?
How can you use the latest standard?What does your function IndicatorCounted() do?
rates_total-1-prev_calculated always equals rates_total-1. prev_calculated always equals 0 and IndicatorCounted() equals bars and then equals 0 so what gives? How is this even right?
How can you use the latest standard?I have no idea what you are talking about.
Please just show the code for the function IndicatorCounted()
I have no idea what you are talking about.
Please just show the code for the function IndicatorCounted()
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[], const double &open[],const double &high[],const double &low[],const double &close[], const long &tick_volume[],const long &volume[],const int &spread[]) { int iIndicatorCounted=IndicatorCounted(); int iPrevCalculated=prev_calculated; Comment( "IndicatorCounted(): "+(string)iIndicatorCounted+"\n"+ "BarsInCalc & IndicatorCounted(): "+(string)(BarsInCalc-(iIndicatorCounted>0?BarsInCalc:iIndicatorCounted))+"\n"+ "rates_total-prev_calculated: "+(string)(rates_total-prev_calculated) ); }
int OnCalculate(const int rates_total,const int prev_calculated,const datetime &time[], const double &open[],const double &high[],const double &low[],const double &close[], const long &tick_volume[],const long &volume[],const int &spread[]) { int iIndicatorCounted=IndicatorCounted(); int iPrevCalculated=prev_calculated; Comment( "IndicatorCounted(): "+(string)iIndicatorCounted+"\n"+ "BarsInCalc & IndicatorCounted(): "+(string)(BarsInCalc-(iIndicatorCounted>0?BarsInCalc:iIndicatorCounted))+"\n"+ "rates_total-prev_calculated: "+(string)(rates_total-prev_calculated) ); }
You are calling a function IndicatorCounted() but you don't show the actual function.
Please show the code for the function IndicatorCounted()
You are calling a function IndicatorCounted() but you don't show the actual function.
Please show the code for the function IndicatorCounted()
It's made by mql5 bro
There is no such function in MQL5.
Are you using a library?
There is no such function in MQL5.
Are you using a library?
- docs.mql4.com
That is a MQL4 function.
Topics concerning MT4 and MQL4 have their own section.
In future please post in the correct section.
I have moved your topic to the MQL4 and Metatrader 4 section.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
How can a bars in calculation be set by a user input as well as all bars so that it doesn't count all bars each time?
Example, we have an input for bars in calculation which if set for 0 meant to calculate all bars.
I think I have the right idea using IndicatorCounted() ..
BarsInCalc-(IndicatorCounted()>0?BarsInCalc:IndicatorCounted())
First tick says 1000 and every tick thereafter says 0 ..
How do you use the latest standard??