Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- discounts are available after registering.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
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!
Can you help answer these questions from other members on NexusFi?
you might want to look at the GetPositionQuantity reserved word. This will provide you with the position for a symbol and side (long/short) for the account of choice.
As TS says it might have some issues and is processor intensive, you might want to check the GetPosProvQty function. You can obtain it from the official forums.