PDA

View Full Version : Do stratgies get turned off completely after session is over?


clam61
05-16-2009, 12:04 AM
in my strategy, i set a timer (System.Timer) that is set to trigger after the session on my chart has ended

this timer never triggers

my question is, does a strategy turn completely off after the session is over?
is this the reason my timer does not fire?

NinjaTrader_Ben
05-16-2009, 10:01 AM
Hello,

A strategy needs an incoming tick to trigger an iteration of you OnBarUpdate() block. So the answer is yes.
Hopefully that helps.

NinjaTrader_Dierk
05-16-2009, 10:53 PM
To clarify: OnBarUpdate only would be triggered as ticks come in (like Ben said). However, your System.Timer would be triggered regardless -> there is something wrong your code. Please consult the Microsoft documents for how to properly use System.Timer.

clam61
05-21-2009, 10:18 PM
my timer starts when the last bar of the session starts. i use 15 minute bars

i set the timer to 1 millisecond and it triggers fine

when i set the timer to 900,000 milliseconds (15 minutes) it does not trigger

NinjaTrader_Dierk
05-21-2009, 10:22 PM
Then your code most likely disables the Timer. There is nothing NT could to prevent a Timer you coded triggering, unless your code disabled that timer. I suggest debugging your strategy by putting in Print() statements where you code enables or disables the timer or where the timer is triggered.

clam61
05-21-2009, 11:26 PM
i have print statements where the timer is started and when the timer is triggered

the timer is never disabled in my code.

NinjaTrader_Dierk
05-21-2009, 11:28 PM
Please provide a simple as possible scenario to reproduce your issue. This should include:
- a simple as possible strategy
- any setup information needed to reproduce the problem

Thanks