can't trade gold with OrderSend()

Back to topics list To post a new topic, please log in or register
avatar
3
Alexmql4 2016.08.15 09:26
 

hi, this is my first program. I want to make a order on Gold symbol by using OrderSend() function on mt4.

I try but when i running on my test. It's always show me EURUSD symbol on my teminal not Gold symbol.

I hope there's someone show me how to i can make order with gold when i compile my demo code.

 Tks so much.

 //////////////////////

int start()

  {

   double TakeProfitLevel;

   double StopLossLevel;

 

   TakeProfitLevel = Bid + TakeProfit*Point;   //0.0001

   StopLossLevel = Bid - StopLoss*Point;

  

   Alert("TakeProfitLevel = ", TakeProfitLevel);

   Alert("StopLossLevel = ", StopLossLevel);

   OrderSend(Symbol(), OP_BUY, 1.0, Ask, 10, StopLossLevel, TakeProfitLevel, "My 1st Order!");

   return(0);

  } 

/////////////////// 

avatar
Moderator
3406
GumRai 2016.08.15 11:26 #
 
Attach the EA to a gold chart.
avatar
3
Alexmql4 2016.08.15 12:00 #
 
it's easy. Tks bro so much. 
avatar
3
Alexmql4 2016.08.15 12:04 #
 
GumRai:
Attach the EA to a gold chart.
Alexmql4:
it's easy. Tks bro so much. 

But it's seem not running. I can see EA on my terminal affter attach it. But i can't it do anything on my code (ex: Aleart ). Can you guide me.

 

Tks u. 

avatar
12985
WHRoeder 2016.08.15 13:56 #
 
  1. Don't paste code
    Play video
    Please edit your post.
    For large amounts of code, attach it.

  2. TakeProfitLevel = Bid + TakeProfit*Point;   //0.0001
    StopLossLevel = Bid - StopLoss*Point;
    Stops must be adjusted to TickSize
    Do NOT use NormalizeDouble, EVER. For ANY Reason. It's a kludge, don't use it. It's use is always wrong

Back to topics list  

To add comments, please log in or register