Advanced search
Quantiacs
Quantiacs > Specific holding periods / time based trading rules View modes: 
Yaku - 11/16/2018 3:41:06 AM
   
Specific holding periods / time based trading rules
All,

what is the easiest way to implement to trade based on a spcified holding period and to onky trade at certain times?

Example 1: I enter a trade but would not like to exit it after the conditions I have specified are no longer met but the exit is fixed after e.g. 5 days of holding period.  

Exampe 2: I'd like to enter and exit my trades based on the specified rules but would only like these rules to be evaluated every 30 trading days. 

Sorry if this is a very basic question, but I'm just starting. 

Thanks

yaku2k - 11/18/2018 2:24:04 PM
   
RE:Specific holding periods / time based trading rules
No easy solution ?
lets say I have a simple moving average crossover system and want to exit 5 days after the crossing of the two moving averages. What’s the easiest way to implement this 5 day exit rule ? Thanks for any help on this.

Eric - 11/20/2018 9:03:28 AM
   
RE:Specific holding periods / time based trading rules
yaku2k,

You can do this with our toolbox.  Each time the myTradingSystem(...) function of your strategy is called, we pass you date information and your current settings.  If you need to track the passage of time, store the required data in the settings, like this:

settings['finalDate'] = xxx

the myTradingSystem(...) function will return the settings dictionary to our evaluation engines.  The next time we call the myTradingSystem(...) function, this value will be part of the settings and you can read it and modify it as required.

I hope this helps.

Eric

1