|
Como, Italy
Experience: Advanced
Platform: Tradestation, IB
Broker: Tradestation, IB
Trading: ES
Frequency: Daily
Duration: Minutes
Posts: 184 since Aug 2014
Thanks Given: 302
Thanks Received: 312
|
Hello,
after a couple of months I'm running the strategy today happened that, I think due to several platform disconnections, the strategy continued to send to market closing orders like if it didn't recognize they already were sent before.
So at the end instead of find myself long 1 contract I was long 3 contracts with only 1 contract to close the position at target. (yes I was not there, it happened during the nigh and I was sleeping)
It's the first time it happens but platform disconected several times and I never had this kind of problem before...maybe is due to the fact I'm using the 9.5...
anyway in order to prevent such thing again I was thinking to use some kind of protection but I need help to code the variable...and even if figure out something I still have some doubt if can work...can you help?
vars : cont(0) ;
cont = currentcontract ....I should assign a value to this var consider I have no overnight positions.
if currentcontracts > 1 then begin
sell (currentcontract - cont) contract this bar at close ;
end;
Thanks for your help!
|