Qualcuno può aiutarmi con questo.
Voglio mettere SL nel mio consulente esperto in questo modo: 1 pip sotto la legge precedente per l'acquisto e 1 pip al di sopra del massimo precedente per la vendita.
E il mio livello Tp sarebbe calcolato in questo modo: per comprare e vendere l'entrata mi piacerebbe moltiplicare il mio livello di stop per 1.3 e questo sarebbe il mio TP.
Quindi se il mio SL è 20 il mio TP sarebbe 26
Codice inserito/Compra se (Ordine == SIGNAL_BUY) {if (! IsTrade) {//Verifica margine libero se (AccountFreeMargin () lt; (1000 * lotti)) {Stampa (Non abbiamo soldi. Margine libero =, AccountFreeMargin ()); ritorno (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 gt; 0) {if (OrderSelect (Ticket, SELECT_BY_TICKET, MODE_TRADES)) {Stampa (ordine BUY aperto:, OrderOpenPrice ()); se (SignalMail) SendMail (# 91; Signal Alert # 93 ;, 91; Symbol () # 93; DoubleToStr (Ask, Digits) Open Buy); } else {Stampa (Errore nell'apertura dell'ordine BUY:, GetLastError ()); }} return (0); }}/Vendi if (Ordine == SIGNAL_SELL) {if (! IsTrade) {//Controlla margine libero se (AccountFreeMargin () lt; (1000 * lotti)) {Stampa (Non abbiamo soldi. Margine libero =, AccountFreeMargin ()); ritorno (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 gt; 0) {if (OrderSelect (Ticket, SELECT_BY_TICKET, MODE_TRADES)) {Stampa (Ordine di vendita aperto:, OrderOpenPrice ()); se (SignalMail) SendMail (# 91; Signal Alert # 93 ;, 91; Symbol () # 93; DoubleToStr (Bid, Digits) Open Sell); } else {Stampa (Errore nell'apertura dell'ordine SELL:, GetLastError ()); }} return (0); }} return (0); }/ ---------------------------------------------- --------------------