Hi !
I'm wondering how to do that ...:/ the warning appeared @ the last update
Note that you must define SL as price and not as relative points, as you are doing.
The exception is value 0, that indicates no SL or no TP.
Note that you must define SL as price and not as relative points, as you are doing.
The exception is value 0, that indicates no SL or no TP.
Hi !
I'm wondering how to do that ...:/ the warning appeared @ the last update
just modify as followed...
if(OrderSend(request,result)) {...};
warning should disappear.
Right, this will solve the OrderSend() return value check warning, but will not check the return (you need the else condition, as below).
Documentation of Ordersend :
In case of a successful basic check of structures (index checking) returns true. However, this is not a sign of successful execution of a trade operation. For a more detailed description of the function execution result, analyze the fields of result structure.
Really? I think you misunderstood my point.
Not at all. You are right that he has to add an "else" statement. But not in the way your code is showing. Even if OrderSend() return true, you can have a problem with your trading operation.
bool res=OrderSend(request,result); if(res && (result.retcode=xx || result.retcode=yy ....)) { Trade operation is ok ...}; else {... return error value check here ...};
Not at all. You are right that he has to add an "else" statement. But not in the way your code is showing. Even if OrderSend() return true, you can have a problem with your trading operation.
Sorry, but I really think you misunderstood my point.
First of all, I said that there was an error at the original code (about SL), and that this is the first and more relevant point to me.
And after, I was trying to say that post below, before mine (and not mine), is not enough to test all OrderSend() return conditions, as looks like you are trying to say.
Forum on trading, automated trading systems and testing trading strategies
return value of 'OrderSend' should be checked
xhxiang, 2014.05.03 04:53
just modify as followed...
if(OrderSend(request,result)) {...};
warning should disappear.
Sorry, but I really think you misunderstood my point.
First of all, I said that there was an error at the original code (about SL), and that this is the first and more relevant point to me.
And after, I was trying to say that post below, before mine (and not mine), is not enough to test all OrderSend() return conditions, as looks like you are trying to say.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi !
I'm wondering how to do that ...:/ the warning appeared @ the last update