Can somebody help me with this.
I want to put SL in my expert advisor like this: 1 pip belowe previus low for buy entry and 1 pip above previus High for sell entry.
And my Tp level would be calculated like this: for buy and sell entry i would like to multiple my stop level for 1.3 and that would be my TP.
So if my SL is 20 my TP would be 26
I want to put SL in my expert advisor like this: 1 pip belowe previus low for buy entry and 1 pip above previus High for sell entry.
And my Tp level would be calculated like this: for buy and sell entry i would like to multiple my stop level for 1.3 and that would be my TP.
So if my SL is 20 my TP would be 26
Inserted Code
//Buy if (Order == SIGNAL_BUY) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point * P; else StopLossLevel = 0.0; if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point * P; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) { Print("BUY order opened : ", OrderOpenPrice()); if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy"); } else { Print("Error opening BUY order : ", GetLastError()); } } return(0); } } //Sell if (Order == SIGNAL_SELL) { if(!IsTrade) { //Check free margin if (AccountFreeMargin() < (1000 * Lots)) { Print("We have no money. Free Margin = ", AccountFreeMargin()); return(0); } if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point * P; else StopLossLevel = 0.0; if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point * P; else TakeProfitLevel = 0.0; Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink); if(Ticket > 0) { if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) { Print("SELL order opened : ", OrderOpenPrice()); if (SignalMail) SendMail("[Signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell"); } else { Print("Error opening SELL order : ", GetLastError()); } } return(0); } } return(0); } //+------------------------------------------------------------------+