
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
Hi WHRoeder,
I will try that out. Thanks. But for the case of a trade hitting stop loss, what can I use to identify that? Thanks
You can check the OrderClosePrice() vs OrderStopLoss() of the closed order, it isn't exact though, if price moves past your SL it can close at a price that isn't your SL.
Looks like my post didn't get through. Wanted to ask. Do the commands you suggested shows the price at stop loss? If so, what I actually meant is, is there a command to indicate that the trade hit stop loss and is closed? Instead of still open and running?thanks!
Looks like my post didn't get through. Wanted to ask. Do the commands you suggested shows the price at stop loss? If so, what I actually meant is, is there a command to indicate that the trade hit stop loss and is closed? Instead of still open and running?thanks!
Could anyone advise what's wrong with the below?
should i not use the loop? it does not modify, with ordermodify error 4051. or is one of my ordertype wrong? hmm
Could anyone advise what's wrong with the below?
should i not use the loop? it does not modify, with ordermodify error 4051. or is one of my ordertype wrong? hmm
How do you know that your SL is less than the OrderOpenPrice () ?
If you don't take the advice you are given why should people still help you ?
Amongst other things yes, did you replace NULL with 0 ? did you code checks on the return values and report all errors ? how are you recovering if your EA has to stop and restart ?
What if the OrderSend() fails ? you will have a ticket number of -1 in your array . . . read this: What are Function return values ? How do I use them ?
Why aren't you checking the return value from the OrderModify() ? if it fails you could print the error number, the Bid and Ask prices, the current OrderOpenPrice() the new SL you are trying to set and then you might be able to find out why you are getting an error 4051.
Hi Raptor,
sorry, i did not address all of your questions. So the normal standard is actually to write the ticket numbers to a file and retrieve from there if need to? I am still not good with all the commands.
But one thing i really don't understand is...
I tried to put a Print("x[j]", x[j]) after the orderselect.... .what i keep getting is the value 0.
if i put the print at x[i], before i++, i get the same value i.e. 0. but y has a value.. .
why is the array not storing my ticket number?
why is the array not storing my ticket number?