Hi,
Im wondering if anyone can explain the following error; Ive got a small bit of code to step-up the stop to x when n pip profit is hit, it goes a little something like this:
Now this works great UNTIL the variable 'Stop1' lies on increments of 10 between the values 100 and 150 (5 digit broker), when it will often loop 'OrderModify error 1' or on live account just bosh me off a hundred emails.
Obviously this isnt a major issue as i can just change it to something like 137 and it will work, im just wondering if any one can offer an explanation for this odd behaviour?
Im wondering if anyone can explain the following error; Ive got a small bit of code to step-up the stop to x when n pip profit is hit, it goes a little something like this:
PHP Code
extern double Level1 = n;
extern double Stop1 = x;
....
if (OrderType()==OP_BUY){
if (OrderStopLoss() < OrderOpenPrice()+(Stop1/100000)){
if (OrderProfit() / (MarketInfo(Symbol(), MODE_TICKVALUE) * OrderLots()) >= Level1){
OrderModify(OrderTicket(), OrderOpenPrice(), (OrderOpenPrice()+(Stop1/100000)), OrderTakeProfit(), OrderExpiration());
}}}
Obviously this isnt a major issue as i can just change it to something like 137 and it will work, im just wondering if any one can offer an explanation for this odd behaviour?
Long live dynamic range