| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| reliable delete pending code https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=1607 |
Page 1 of 1 |
| Author: | Spectre [ Mon Mar 11, 2013 7:18 pm ] |
| Post subject: | reliable delete pending code |
hello i am growing increasingly frustrated with myself. i cannot get my code to work right. i want the code to close all pending orders at bar close, but whatever i try it sometimes leaves trades behind. it goes on offline/renko charts, so using expiration on the pending is unfortunately not going to work. i have tried Time[0] > Time[1], Close[] value coding, Code: Select all i bet if someone here gives me the answer or something closer to a solution, i will slap my head and cry myself to sleep in shame over its simplicity Thomas |
|
| Author: | magft [ Mon Mar 11, 2013 10:02 pm ] |
| Post subject: | Re: reliable delete pending code |
Why not try Code: Select all Code: Select all Code: Select all Regards Mike |
|
| Author: | slipshod [ Sat Apr 06, 2013 6:32 am ] |
| Post subject: | Re: reliable delete pending code |
Not sure if Spectre's found a solution to this problem yet, but its one I ran into as well. A couple of things to check:- Firstly are you looping from 0 to OrdersTotal() in a for loop? If so, OrdersTotal() will vary with each trade deleted & you're highly likely to get some left behind. This happens even if you do: int total=OrdersTotal() and then for (i=0; i<total; i++). The solution is for (i=total-1; i>=0; i--) Secondly its possible that even that doesn't get the job done. You might want to try something like this:- Code: Select all |
|
| All times are UTC | Page 1 of 1 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|