//--- indicator settings #property indicator_separate_window #property indicator_buffers 3 #property indicator_maximum 1.0 #property indicator_minimum 0.0 #property indicator_height 100
Add two lines.
There are so many useless descriptions that it should be better organized.
Add two lines.
There are so many useless descriptions that it should be better organized.
Thanks a lot Nagisa, this code I was trying to covert from MQL5 to MAL4. need to used it temporarily, until my MQL5 versions start working perfectly well.
Yes adding these lines helped to run this for now. Let me test it for few days to be sure it is working.
Descriptions are for my understanding, however I realized that I should have removed them while posting on Forum.
Descriptions are for my understanding, however I realized that I should have removed them while posting on Forum.
No, that's not what I'm saying. I'm saying that there are many duplicates and unnecessary lines.
For example,
ArraySetAsSeries(buffer_BuySignal,true); ArraySetAsSeries(buffer_SellSignal,true); ArraySetAsSeries(buffer_Neutral,true);
In MT4, "true" is the default, so these are not necessary.
SetIndexLabel(0,"BuySignal"); SetIndexLabel(1,"SellSignal"); SetIndexLabel(1,"Neutral");
These are duplicate of the label name you wrote in the profile.
myPoint = Point(); if(Digits() == 5 || Digits() == 3) { myPoint *= 10; }
This is an unused variable.
And so on.
No, that's not what I'm saying. I'm saying that there are many duplicates and unnecessary lines.
For example,
In MT4, "true" is the default, so these are not necessary.
These are duplicate of the label name you wrote in the profile.
This is an unused variable.
And so on.
Thanks Nagisa for your reply and comments.
1) in MQL5 when use SetIndexBuffer() is used, array is automatically assumed to be as timeseries. I was not aware of MQL4, so just left it there.
2) SetIndexLabel(1,"Neutral"); ... ERROR Noted and thanks for pointing it out.
3) myPoint ... I want to use it in the indicator to handle currency pairs, which have 4/5 decimal OR 2/3 decimal points. However, could not realize how to use it, and hence left in the code as a reminder to do it.
Indicator is working now, thanks to error pointed out by you for indicator_minimum and indicator_maximum. As I have already shifted to MQL5, I am concentrating to serious errors only in MQL4 version.
I would be obelized if you can help me to trace zero_divide error as following line is failing to get MAvalue on different time frame. The error is not frequent but happens some time.
double EMA_Price = NormalizeDouble(iMA(_Symbol,PERIOD_M15,MA_Period,0,MODE_SMA,PRICE_CLOSE,i),Digits) ... while I am working on PERIOD_M5 or PERIOD_M30/H1.
I would be obelized if you can help me to trace zero_divide error as following line is failing to get MAvalue on different time frame. The error is not frequent but happens some time.
double EMA_Price = NormalizeDouble(iMA(_Symbol,PERIOD_M15,MA_Period,0,MODE_SMA,PRICE_CLOSE,i),Digits) ... while I am working on PERIOD_M5 or PERIOD_M30/H1.
Zero division is what occurs in division. However, I don't see any division in this program, so I don't know what's going on.
Zero division is what occurs in division. However, I don't see any division in this program, so I don't know what's going on.
I remember one of your suggestion in earlier post. I used if(EMA_Price != 0) then do the calculation. Hope it should be working. as I told you earlier, this error is not frequent but happens sometimes.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use