- Indicators with alerts/signal
- please help me on this indicator
- I-Trend Crossover arrow alert
-
if(counted_bars>0) counted_bars--; limit=Bars-counted_bars; for(i = 0; i <= limit; i++) {
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 programming forum
-
First run counted_bars is zero, but you run up to Bars, which does not exist, array exceeded, indicator stops, if you used strict. Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016) - Ismail Lemin: I tried to edit the signal arrow to occur on the current candle aSo why are you trying to read the future?
fasterEMAafter = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i-1);
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.
-
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 programming forum
-
First run counted_bars is zero, but you run up to Bars, which does not exist, array exceeded, indicator stops, if you used strict. Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016) - So why are you trying to read the future?
Hello William, I removed the decrement and also edited the event handlers to the latest mql4 strict standards. I still can't figure out the what will have signal arrow to occur on the current candle before it closes. I have tried to change the PRICE CONSTANT (PRICE_CLOSE), removed the decrement
fasterEMAnow = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i); fasterEMAprevious = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i+1); fasterEMAafter = iMA(NULL, 0, FasterEMA, 0, MODE_EMA, PRICE_CLOSE, i-1); // tried to change PRICE_MEDIAN slowerEMAnow = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, i); slowerEMAprevious = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, i+1); slowerEMAafter = iMA(NULL, 0, SlowerEMA, 0, MODE_EMA, PRICE_CLOSE, i-1); // tried to remove the i-1
but still failed. Please help out to get this to work. Please help me, my coding knowledge is little, and I struggle to get it right sometimes.
-
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 programming forum
-
First run counted_bars is zero, but you run up to Bars, which does not exist, array exceeded, indicator stops, if you used strict. Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016) - So why are you trying to read the future?
-
No need for the decrement. Contradictory information on IndicatorCounted() - MQL4 programming forum
-
First run counted_bars is zero, but you run up to Bars, which does not exist, array exceeded, indicator stops, if you used strict. Always use strict. Fixing the warnings will save you hours of debugging, but you must understand the differences.
-
You should stop using the old event handlers (init, start, deinit) and IndicatorCounted() and start using new event handlers (OnInit, OnTick/OnCalculate, OnDeinit).
Event Handling Functions - MQL4 Reference
How to do your lookbacks correctly - MQL4 programming forum #9-14 & #19 (2016) - So why are you trying to read the future?
Help you with what? You were given several problems but have not shown your fix (using the CODE button) nor stated the nature of your difficulty.
No free help (2017)
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)
We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
No free help (2017)
Help you with what? You were given several problems but have not shown your fix (using the CODE button) nor stated the nature of your difficulty.
No free help (2017)
Or pay someone. Top of every page is the link Freelance.
Hiring to write script - General - MQL5 programming forum (2018)
We're not going to code it for you (although it could happen if you are lucky or the issue is interesting).
No free help (2017)

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use