- Brt88: explain to me if this code should work.You haven't found a value for zigzag1 yet.
SLforSell= MathRound((zigzag1+0.04*ATRd)/Point)*Point; SLforBuy= MathRound((zigzag1-0.04*ATRd)/Point)*Point;
if(OrderSelect(i, SELECT_BY_POS) && OrderSymbol()==Symbol() ) { ticket = OrderTicket(); ..
Using OrdersTotal directly and/or no Magic number filtering on your OrderSelect loop means your code is incompatible with every EA (including itself on other charts and manual trading.) Symbol Doesn't equal Ordersymbol when another currency is added to another seperate chart . - MQL4 forum- Check your return codes What are Function return values ? How do I use them ? - MQL4 forum and Common Errors in MQL4 Programs and How to Avoid Them - MQL4 Articles
so stupid oversight, thank you very much WHRoeder ! :)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi all.
Plz explain to me if this code should work. I want to use ZigZag to manage SL. In order that i look for 3 last value>0 of the indicator. Than I want to use this 3 values in further conditions. Will this 3 val change in every thick? (I copied essential part of code, because whole thing has over 500 lines ).
Will it "zigzag0< zigzag2 && zigzag0<zigzag1 && zigzag1>zigzag2 && Close[1]<zigzag2" be cheeked every thick? i suppose no...Plz help me make it work.