[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[amibroker] Sell n days later



PureBytes Links

Trading Reference Links

I'm new to AmiBroker, and I'm trying to code a simple ranking system. I was hoping to use the rotational trading function, but I don't think I can add an additional sell parameter using this.

I want to buy and remain in the top 10 ranked issues according to my ranking criteria. I want to replace a position when it falls out of the top 10 but not until it has been held for a minimum of 30 days.

I don't understand how to access the position entry date of the individual issues to see if 30 days has passed. Here's the idea.

    SetOption("MaxOpenPositions", 10)
    Sell = (30 days have passed since opening the position)
    Buy = True
    PositionScore= myRankingScheme

Forgive my crude attempt at coding, my understanding of the concepts are hazy. I have no idea how to quantify the Sell variable to indicate 30 days have passed for a particular position. I believe if Sell was set to true, the portfolio would always contain the top 10 positions without the 30 day qualifier. If sell was set to false the portfolio would remain in the original top 10 positions. Correct me if I'm wrong.

Thanks for helping me get started.

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

For other support material please check also:
http://www.amibroker.com/support.html





Yahoo! Groups Links