ST e o TK não são preenchidos

 

Olá

Estou tentando fazer um EA MQL4 que está rodando sem erros e até abre posições de compra ou venda mas o ST e o TK não são preenchidos

Esta são as linhas  :

  result=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"EA tresButton.mq4",16384, 0,Blue);


  result=OrderSend(Symbol(),OP_SELL,Lots,Ask,3,Ask+StopLoss*Point,Ask-TakeProfit*Point,"EA tresButton.mq4",16384, 0,Blue);

 O que devo fazer para que as ordens abram com o TakeProfit e StopLoss preenchidos?

Muito obrigado
 

https://www.mql5.com/pt/forum/mql4

Please use English only on this forum.

 
  1. English only on this forum.

  2. When you post code please use the CODE button (Alt-S)! (For large amounts of code, attach it.) Please edit your post.
              General rules and best pratices of the Forum. - General - MQL5 programming forum
              Messages Editor

  3. result=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,Ask-StopLoss*Point,Ask+TakeProfit*Point,"EA tresButton.mq4",16384, 0,Blue);
    result=OrderSend(Symbol(),OP_SELL,Lots,Ask,3,Ask+StopLoss*Point,Ask-TakeProfit*Point,"EA tresButton.mq4",16384, 0,Blue);
    You buy at the Ask and sell at the Bid.
    • Your buy order's TP/SL are triggered when the Bid reaches it. Not the Ask.
    • Your sell order's TP/SL will be triggered when the Ask reaches it. To trigger at a specific Bid price, add the average spread.
                MODE_SPREAD (Paul) - MQL4 and MetaTrader 4 - MQL4 programming forum - Page 3
    • The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools -> Options {control-O} -> charts -> Show ask line.)

Reason: