![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2009
Posts: 69
Thanks: 0
Thanked 2 times in 2 posts
|
Hi,
I'm trying to reset certain variables at the beginning of each session. I'm running my strategy on a 60 min chart, but I also have 15 min and 1 min bars added to the strategy. I'm also running it with COBC = false. I was trying this expression: if (Bars.FirstBarOfSession && BarsInProgress == 2) with BarsInProgress (2) being the 1 min bar. When looking at the output window though, I'm getting multiple resets for about the first 15 min, then the routine stops. My expectation is that it runs once and is done. Is it running on all the ticks during the first minute? I also have part of my strategy running on FirstTickOfBar. Should I put the routine in there? Thanks, Rich |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Hi Rich,
Are you using version 6.5 or 7? There have been changes to multiseries for version 7 and want to make sure I'm checking this out for the right version.
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2009
Posts: 69
Thanks: 0
Thanked 2 times in 2 posts
|
I'm using version 7
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2009
Location: Denver, CO
Posts: 8,117
Thanks: 249
Thanked 418 times in 415 posts
|
Thanks.
I believe this should work better for you. if (BarsInProgress == 2) { if (Bars.FirstBarOfSession && FirstTickOfBar) Print("First Bar of 1 minute " + Times[2][0]); }
Ryan M
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Mar 2009
Posts: 69
Thanks: 0
Thanked 2 times in 2 posts
|
I'll check it out tomorrow morning. Thanks!
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Resetting Sim101 | cgeorgan | Version 7 Beta General Questions & Bug Reports | 1 | 08-11-2010 09:10 AM |
| Resetting a variable | trader413 | Strategy Development | 8 | 09-14-2009 10:12 AM |
| resetting indicators | dirtybrown | Indicator Development | 9 | 06-01-2009 02:06 PM |
| Resetting account performance ? | T2020 | Miscellaneous Support | 2 | 09-08-2008 07:25 AM |
| Data values resetting | Burga1 | Indicator Development | 5 | 05-23-2008 03:25 PM |