HELP PLEASE!!!!!
https://www.youtube.com/watch?v=f_LfSAamO44
}
}
}
Hi ! I´ve got a problem with this code, its a trailing stop just for BUY operations for now, when i have an open trade
,see what happens, i dont understand why it modifies StopLoss so many times with random values. I wrote
Print
function to check which value was sending, and it is the right value! , but when you put "slcompra" in OrderModify , 1: It
modifies so many times, 2: it modifies random values , no sense. Im attaching 2 screenshots to help you. Thanks
Hello,
try this code......
//--- bool OrdrModify=false; double TSCompra=10;//It's only for testing this parameter. Not need to copy in your code. double slcompra=0; //--- for(int b=OrdersTotal()-1; b>=0; b--) { if(OrderSelect(b,SELECT_BY_POS,MODE_TRADES)) { if(OrderSymbol()==Symbol()) { Comment(DoubleToStr(Ask,_Digits) + "-" + DoubleToStr((TSCompra*_Point),_Digits) + "=" + DoubleToStr((Ask-(TSCompra/100)),_Digits)); slcompra= Ask - (TSCompra*_Point) ; if(OrderType()==OP_BUY) { if(OrderStopLoss() < slcompra) OrdrModify=OrderModify(OrderTicket(),OrderOpenPrice(),slcompra,OrderTakeProfit(),0,CLR_NONE); } } } } //---
Hello,
try this code......
Happens exactly same thing
- Don't say that. Anyone searching and finding this thread will learn nothing. Post what you did.
- SL/TP (stops) need to be normalized to tick size (not Point.) (On 5Digit Broker Stops are only allowed to be placed on full pip values. How to find out in mql? - MQL4 programming forum) and abide by the limits Requirements and Limitations in Making Trades - Appendixes - MQL4 Tutorial and that requires understanding floating point equality Can price != price ? - MQL4 programming forum
- Please edit your (original) post and use the CODE
button (Alt-S)! (For large amounts of code, attach it.)
General rules and best pratices of the Forum. - General - MQL5 programming forum
Messages Editor
}
}
}
Hi ! I´ve got a problem with this code, its a trailing stop just for BUY operations for now, when i have an open trade ,see what happens, i dont understand why it modifies StopLoss so many times with random values. I wrote Print function to check which value was sending, and it is the right value! , but when you put "slcompra" in OrderModify , 1: It modifies so many times, 2: it modifies random values , no sense. Im attaching 2 screenshots to help you. Thanks