//---- if the SELL position has been opened, if(OrderType() == OP_SELL) { Print("QUANTEEE111444444 "+(Bid)); Print("QUANTEEE1113333 "+(OrderOpenPrice())); Print("QUANTEEE "+(OrderOpenPrice()- (ProfitMin*Point))); Print("QUA "+CtrlSellTP); //if((Ask-OrderOpenPrice())<ProfitMin*Point*10 && CtrlSellTP==0) if((Bid <= ND((OrderOpenPrice()-(ProfitMin*Point)))) && (CtrlSellTP==0)) { Print("SONO QUIIIIIIII "+ND((Bid-Point4TS*Point))); double NewSL=ND(Bid-(Point4TS*Point)); bool resOM=OrderModify(OrderTicket(),OrderOpenPrice(),NewSL,OrderTakeProfit(),0,Yellow); // CtrlSellTP=1; }
How can the SL be below the Bid on a sell order?
also if i use Ask do the same error
if(OrderType() == OP_SELL) { Print("QUANTEEE111444444 "+(Ask)); Print("QUANTEEE1113333 "+(OrderOpenPrice())); Print("QUANTEEE "+(OrderOpenPrice()- (ProfitMin*Point))); Print("QUA "+CtrlSellTP); //if((Ask-OrderOpenPrice())<ProfitMin*Point*10 && CtrlSellTP==0) if((Ask <= ND((OrderOpenPrice()-(ProfitMin*Point)))) && (CtrlSellTP==0)) { Print("SONO QUIIIIIIII "+ND((Ask-Point4TS*Point))); double NewSL=ND(Ask-(Point4TS*Point)); bool resOM=OrderModify(OrderTicket(),OrderOpenPrice(),NewSL,OrderTakeProfit(),0,Yellow); // CtrlSellTP=1; }
faustf: also if i use Ask do the same error
What part of "How can the SL be below the Bid on a sell order" was unclear to you?
faustf:
also if i use Ask do the same error
if(NewSL!=OrderStopLost()) bool resOM=OrderModify(OrderTicket(),OrderOpenPrice(),NewSL,OrderTakeProfit(),0,Yellow);
all is not clear , if i just open a trade sell , after i want set with ordermodify a stoploss X pips after
Ask price is 1.09458 and new stop loss is 1.09451
example
the problem is about because not set a stoploss when open a trade ???
faustf: Ask price is 1.09458 and new stop loss is 1.09451
That is impossible. That would be a Take Profit for a sell.
but if the beaten price is below the take profit price I don't think it can be entered because the price has already exceeded the take profit.
but thanks again i will try to find a solution

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
hy , i dont know why in my script return always error 130 if i set a price 1.09556 for example work
anyone can help me ? thnks