How to Close All Active Positions at 15-55 EST?
Author: leeto
Creation Date: 6/3/2015 8:53 AM
profile picture

leeto

#1
Hi, I would like that all my positions were closed at the end of the day (15-55 EST ). I already dig a little bit to Navigation: Programming Trading Strategies >Multi-Position Strategies. However, I probably made some mistake and it don't work.

Please take a look on my code below. Once again my problems is my positions is still active after 15-55 EST

CODE:
Please log in to see this code.
profile picture

Cone

#2
You don't need the Position loop. Just do this:

CODE:
Please log in to see this code.
profile picture

leeto

#3
nope, don't work properly ...

In exit name row there isn't a single exit with name "1555"
profile picture

Eugene

#4
I wonder which data provider and bar scale are you using?

QUOTE:
In exit name row there isn't a single exit with name "1555"

Eliminate the "for(int)" block completely as Cone suggested above.

QUOTE:
BuyAtStop( bar, Bars.Open[bar] );

fyi, as this will not produce Alerts, change "bar" to "bar+1".
profile picture

leeto

#5
QUOTE:
I wonder which data provider and bar scale are you using?


Google


CODE:
Please log in to see this code.


NO exits at the end of the day at all
profile picture

Eugene

#6
QUOTE:
Google


What does "Google" mean? Please clarify before we proceed.
profile picture

leeto

#7
Google Finance has API for receiving market data I made simple excel VBA app that helps me get market data and I upload that data in Wealth-lab as txt file
profile picture

Eugene

#8
Got it. With syntax error fixed...

CODE:
Please log in to see this code.
profile picture

leeto

#9
ohhh ... of course bracket . Eugene thx you so much !