![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Mar 2011
Posts: 53
Thanks: 7
Thanked 0 times in 0 posts
|
I have problem when using this code in backtest in 1 range chart that it only show 1 day of result when back testing multiple days. Am I missing something?
Code:
if(Bars.BarsSinceSession)
{
}
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello er111222,
Bars.BarsSinceSession returns an integer. Code:
if (Bars.BarsSinceSession == 3)
{
//do something
}
If you want to check if the bar is the first bar of session then please use the FirstBarOfSession function. Code:
if (Bars.FirstBarOfSession)
{
//do something
}
Please let me know if I can assist you any further.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Mar 2011
Posts: 53
Thanks: 7
Thanked 0 times in 0 posts
|
Sorry I mean the problem happened when use
Code:
if (Bars.FirstBarOfSession)
{
//do something
}
|
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Dec 2011
Location: India
Posts: 3,286
Thanks: 580
Thanked 546 times in 541 posts
|
Hello er111222,
Can you send a toy code* replicating the scenario to support[AT]ninjatrader[DOT]com Please append Attn:Joydeep in the subject line of the email and give a reference of this thread in the body of the email. I look forward to assisting you further. *The "toy" just means something that is a stripped down version that isn't necessarily the whole logic. It makes things easier to rout out.
Joydeep M.
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Bars.FirstBarOfSession | trtrav | Strategy Development | 5 | 06-27-2011 10:48 AM |
| Bars.FirstBarOfSession doesn't work with Renko bars | gregid | Version 7 Beta General Questions & Bug Reports | 20 | 05-24-2010 08:17 AM |
| Bars.FirstBarOfSession | MXASJ | Version 7 Beta General Questions & Bug Reports | 5 | 05-17-2010 08:28 AM |
| why does not Bars.FirstBarOfSession not fired | junkone | Strategy Development | 3 | 04-29-2009 09:42 AM |
| Bars.FirstBarOfSession not set to true during backtest? | tradefaz | General Programming | 1 | 09-03-2008 08:19 AM |