1. Correct your mistake:
int EMA1Definition = iMA(_Symbol,_Period,1,0,MODE_EMA,PRICE_CLOSE);
you create an indicator handle at every tick! REMEMBER: The MQL5 style implies that the indicator handle is created ONCE and must be done in OnInit.
1. Correct your mistake:
you create an indicator handle at every tick! REMEMBER: The MQL5 style implies that the indicator handle is created ONCE and must be done in OnInit.
Thanks, did you have some links for all of this kind of best practice MQL5
Because I learn by myself on Youtube and I am not say that the video I watch is a bad tutor/teacher. But Probably this kind of rules must be in the introduction of how to programming in the right ways. Like my old always boss said "Do the right thing first for the first time and every time"
===
Back to the point, strategy tester sometimes can shows the horizontal lines on rarely occassions. but not like in the live chart when I put data of like 20 charts, the lines is dynamically change when the high and low changes
But it show as static lines in visual mode, even after days of simulations and the price already goes above or below
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I put some horizontal line for High, Low and Middle line and it can be show when I put it on the chart. But seems the horizontal line not showing when I did the Strategy tester so I can't really evaluate my strategy fully
My analogy on this is if you still play in the range it will be okay, but if the play getting more dangerous, please use condom (the SL) LOL
I have some condition when trade near the high line and low line to put some stop loss,I can see the stop loss happen but I don't know if those the ask or bid price on the range of those line because I can't see those lines
I am sorry if my code is not really efficient, cause I just learn MQL 5 for 2-3 days. I will appreciate if someone can show me the better declaration tough. Those 3 horizontal lines can be show on live chart
Right now I am testing the stop loss condition on my development stage, I can see the open position with stop loss but the problem is just can't review it in visual mode with lines
Thanks In advance for some help
Daniel