RaptorUK:
Did your OrderSend work ? why aren't you testing it's return value to check if it worked ? if it fails your ticket number is -1, then both of your OrderSelect() ( why 2 ?? ) fail as well . . . and then you report that your OrderSend failed even if it's your OrderSelect() that didn't work . . .
if (ticket > 0) ... use just one order select...:)
Did your OrderSend work ? why aren't you testing it's return value to check if it worked ? if it fails your ticket number is -1, then both of your OrderSelect() ( why 2 ?? ) fail as well . . . and then you report that your OrderSend failed even if it's your OrderSelect() that didn't work . . .
RaptorUK:
Did your OrderSend work ? why aren't you testing it's return value to check if it worked ? if it fails your ticket number is -1, then both of your OrderSelect() ( why 2 ?? ) fail as well . . . and then you report that your OrderSend failed even if it's your OrderSelect() that didn't work . . .
Did your OrderSend work ? why aren't you testing it's return value to check if it worked ? if it fails your ticket number is -1, then both of your OrderSelect() ( why 2 ?? ) fail as well . . . and then you report that your OrderSend failed even if it's your OrderSelect() that didn't work . . .
Thanks, I made the change and when I run it I get OrderSend 131 error
ERR_INVALID_TRADE_VOLUME | 131 | Invalid trade volume, error in the volume granularity. All attempts to trade must be stopped, and the program logic must be changed. |
Show your modified code . .
Please use this to post code . . . it makes it easier to read.
phillw:
I am backtesting the following script. The return value for orderprofit is 0 and it should not be.
What am I doing wrong.
int ticket= OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-.0011,Ask+.0014); // Scenario 1
try like this
double sl = Bid - (11* Point); double tp = Bid + (14* Point); int ticket= OrderSend(Symbol(),OP_BUY,0.1,Ask,3,sl,tp); // Scenario 1
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I am backtesting the following script. The return value for orderprofit is 0 and it should not be.
What am I doing wrong.
int ticket= OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Ask-.0011,Ask+.0014); // Scenario 1
OrderSelect(ticket, SELECT_BY_TICKET);
if(OrderSelect(ticket, SELECT_BY_TICKET)==true)
{ Gain_1[k] = OrderProfit() ; }
else
{ Print("OrderSelect returned the error of ",GetLastError()); }