|
|
|
-
Junior Member
Code Question - OrderSend()
Can somebody be kind enough to tell me whats wrong with my code please?
OrderSend(Symbol(), OP_BUY, lots, Ask, 3, Ask-stoploss*Point, Ask takeprofit*Point, Buy trade, magical, Blue);
Thanks
JT
-
Junior Member
Is it true that the parameter between blue, magic have to be 0? I am new to this and get confused.
#property copyright Copyright 2015, MetaQuotes Software Corp..
#property link https://www.mql5.com
#property version 1.00
#property stringent
extern double lots = 0.01;
extern int takeprofit = 72;
extern int stoploss = 24;
extern int magic = 33454;
//p ------------------------------------------------------------------
//| Expert initialization serve |
//p ------------------------------------------------------------------
int OnInit()
//--
opensell();
//--
return(0);
// ------------------------------------------------------------------
//| Expert deinitialization function |
// ------------------------------------------------------------------
void OnDeinit(const int reason)
//--
// ------------------------------------------------------------------
//| Expert tick function |
// ------------------------------------------------------------------
void OnTick()
//--
// ------------------------------------------------------------------
void opensell()
OrderSend(Symbol(), OP_SELL, lots, Bid, 3, Bid stoploss*Point, Bid-takeprofit*Point, Sell trade, magic, Blue);
-
Junior Member
Thanks for the responces but CJA set me straight that it was my broker and not my code.
Thanks everybody
JT
-
Member
[quote=thjw;7988728]Can the parameter between magic, blue have to be 0?
You probably have the expiry date set to blue from the preceding.
-
Junior Member
Hi JT,
comparing it with http://docs.mql4.com/trading/ordersend, I see two different things:
1. You did not normalize TP and SL worth
2. You're missing one parameter between magic and Blue
Greets,