angevoyageur: It's weird. Can you post all the relevant code, including ordersend call and error processing (printing) ?
Yes, it's below as requested
Lot=LotSize/8;
MqlTradeResult StageOneBuyRes={0};
MqlTradeRequest StageOneBuy={0};
StageOneBuy.action=TRADE_ACTION_DEAL;
StageOneBuy.magic=MagicNumber;
StageOneBuy.symbol=_Symbol; // symbol
StageOneBuy.volume=Lot;
StageOneBuy.price=SymbolInfoDouble(_Symbol,SYMBOL_ASK);
StageOneBuy.sl=0; // Stop Loss is not specified
StageOneBuy.tp=0; // Take Profit is not specified
StageOneBuy.deviation =7;
StageOneBuy.type=ORDER_TYPE_BUY; // order type
StageOneBuy.type_filling = ORDER_FILLING_FOK;
StageOneBuy.comment = "test";
MqlTradeResult StageOneSellRes={0};
MqlTradeRequest StageOneSell={0};
StageOneSell.action=TRADE_ACTION_DEAL;
StageOneSell.magic=MagicNumber;
StageOneSell.symbol=_Symbol; // symbol
StageOneSell.volume=Lot;
StageOneSell.price=SymbolInfoDouble(_Symbol,SYMBOL_BID);
StageOneSell.sl=0; // Stop Loss is not specified
StageOneSell.tp=0; // Take Profit is not specified
StageOneSell.deviation =7;
StageOneSell.type=ORDER_TYPE_SELL; // order type
StageOneSell.type_filling = ORDER_FILLING_FOK;
StageOneSell.comment = "test";
You have to use the StageOneBuyRes structure to get information about your order/deal. Mainly you have to check the retcode, please see the documentation or search the site for examples of the use of OrderSend(), it doesn't work like with mql4.
Your code is probably returning an error where there is not. Did you check the terminal to see if a position was open or increased ?
As a side note, but not related to this topic, the following code probably don't do what you think it does.
This code isn't right, you can't use it as you do.
You have to use the StageOneBuyRes structure to get information about your order/deal. Mainly you have to check the retcode, please see the documentation or search the site for examples of the use of OrderSend(), it doesn't work like with mql4.
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Please run this little script on a GBPUSD chart, and report the result.
Please run this little script on a GBPUSD chart, and report the result.
Sorry, I didn't see the post. I was dealing with some of issues I had been having with the mql4 version of this on demo mode.
I'll run the script thanks
Report
"2014.04.02 15:11:27.158 Lot (GBPUSD,D1) Volume min = 0.010000, volume step = 0.010000 for symbol GBPUSD."
Report
"2014.04.02 15:11:27.158 Lot (GBPUSD,D1) Volume min = 0.010000, volume step = 0.010000 for symbol GBPUSD."
It's weird. Can you post all the relevant code, including ordersend call and error processing (printing) ?
Yes, it's below as requested
Lot=LotSize/8;Yes, it's below as requested
This code isn't right, you can't use it as you do.
You have to use the StageOneBuyRes structure to get information about your order/deal. Mainly you have to check the retcode, please see the documentation or search the site for examples of the use of OrderSend(), it doesn't work like with mql4.
Your code is probably returning an error where there is not. Did you check the terminal to see if a position was open or increased ?
As a side note, but not related to this topic, the following code probably don't do what you think it does.
Right I will emend that.
I'm not sure what you mean by checking the terminal, there are not any backtesting results shown there.
Right I will emend that.
I'm not sure what you mean by checking the terminal, there are not any backtesting results shown there.
This code isn't right, you can't use it as you do.
You have to use the StageOneBuyRes structure to get information about your order/deal. Mainly you have to check the retcode, please see the documentation or search the site for examples of the use of OrderSend(), it doesn't work like with mql4.