Number of current open position

Dear all,

anyone know if there's a way to count the number of current open position in AFL ?

Thanks in advance
Regards
No Erocla

Use SEARCH before posting. The answer already exists in the forum: MarketPosition and alternate exit condition

Dear Tomasz thank you for answer,

maybe my post wasn't clear or i don't understand your answer.

During simple portfolio backtesting (not rotational) i would like to understand how many stocks i'm currently holding, and how many stocks i will hold tomorrow, i.e. number of open position.

The purpose is to increase exposure on every single stock if tomorrow i will hold less stocks then today.

Thank you againg
No Erocla

You would need to write a custom back test (CBT) to achieve that sort of rebalancing. I think you need to have a lot more familiarity with AmiBroker before you dive into the CBT.

1 Like

Ok seems clear, what i need can be this:
long GetOpenPosQty()
thank you again and sorry i'am still newby!

If you actually read the post I linked you would find the exact answer to your question, including full coding example that does exactly what you asked for (scaling/rebalancing). But you did not even click on that link I provided (if you clicked it would be visible as (1) number of clicks.

It is pity that people asking questions don't even bother to read answers / links provided.

2 Likes

Maybe cuz im on vpn but i can assure you that i clicked it.
Anyway thank you and sorry for missunderstanding.