need help get open positions of day before

Hello Guys,

New in this forum and its not my intention to waste your time so i will be shortly as i can.

I have a EOD strategy which have 5 max open position, my data is EOD as well so there is no time information about sells and buy in the data.

I need your help to know how can i limit open positions by day but based on the open positions last day.

This strategy has maxopenpositions = 5.

So for instance: I have 4 positions today opened and exit one position today. So at the end of the day (today) i have 3 positions opened so for the next day i have available 2 positions slots.

I run the code in Amibroker, but since there is an exit position the software see an available slot and open a new position in the same day. What i want is to open positions next day based on the open positions last day and less the 5 at the same time.

I have reading several links even with the offcial AB manual, but didnt find the answer.

So, could anybody knows can i getopen positions from the last bar?


openpositions = bo.GetOpenPosQty(); <---- must be for the last bar

I hope to be clear.

Thanks in advance, i really appreciate your help.



Similar threads