Rules: activate a condition after N days
Author: banhmi3t
Creation Date: 4/9/2009 3:15 AM
profile picture

banhmi3t

#1
I want to write a strategy but I don't know the function to use.

The strategy is simple by just using crossover of MA with price. If Price > MA -> Buy. I will flat the position only if the Price < MA. But I want after 3 days since the day of my buying, the exit will be activated.

For example, If I buy today because the Price > MA of the previous 20 days. I want to make sure that within the next 3 days the program will not trigger my Exit even though the Price can below the MA tomorrow. After 3 days since today. The exit will be trigger and checked if the price still < MA then the exit is triggered. If the price > MA then I still hold the stock.

Any helps will be appreciated!

profile picture

Eugene

#2
rivaldo1981, don't register multiple accounts on our website please.

You can easily build this sort of strategy using the Rule-Based Wizard.

Notice the group and the extra Condition: "Current open Position is (not) older than a number of days"
profile picture

banhmi3t

#3
Thank you very much! It's so useful.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).