![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Sunday May 26th at 12PM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Junior Member
|
Hi everyone ,
I have in my strategy calculateOnBarClose = false. And I need set on my indicators calculateOnBarClose=true; Now i have this in my code: CalculateOnBarClose = false; LPcurrentBidAsk.CalculateOnBarClose = false; BBdown.CalculateOnBarClose = true; BBup.CalculateOnBarClose = true; SBdown.CalculateOnBarClose = true; SBup.CalculateOnBarClose = true; emATRdown.CalculateOnBarClose = true; emATRup.CalculateOnBarClose = true; ,but it doesnt work :-(. All indicators are being drawn and redrawn on actual bar after each newcoming tick. I need this for cross for 2 SMA's calculation on bar close (cross must was in bar in past). So i try use a CrossBelow(SMA1,SMA2,1) , but it still dont calculate on bar close. Thanks for help Kellerstein Lukas kellersteinlukas@gmail.com |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Jun 2009
Location: Denver, CO
Posts: 3,149
Thanks: 10
Thanked 89 times in 81 posts
|
Hi Kellerstein, the UI inputs for CalculateOnBarClose take priority over what is set in code. When you add the indicators to the chart, you'll need to specify CalculateOnBarClose = true in the indicator window.
If you set the strategy to COBC = false, everything in the strategy will be COBC = false, including CrossBelow(SMA1, SMA2, 1).
Austin
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Junior Member
|
Hi Austin ,
So i havent in my strategy any indicator with COBC = false and any indicator with COBC = true ?? Will be in NT 7 ? thanks Kellerstein Lukas |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Kellerstein Lukas,
Sorry I am not sure I follow exactly what you are asking. COBC is already in 6.5 so it will be in 7 as well.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Junior Member
|
Josh and Austine,
I need to set global CalculateOnBarClose=false for my strategy. I need method OnBarUpdate() and all what it contains to work all the time during bar when being draw. Not only when it closes. But I need several indicators I use in my strategy to be calculated only from close prices (like I need to know the value of indicator when bar closes, not when being drawn), so to set calculateOnBarClose = true just and only for them. The reasoning example: My first signal for the trade comes when SMA1 and SMA2 cross each other on bar close (not when bar is being drawn), but that way I have to set CalculateOnBarClose = false. The second signal is calculated from tick data. This first signal comes true when the two SMAs cross each other durin bar being just calculated (redrawn) and theat is undesirable result. I want this signal to be true only when that happens on bar close data (after bars close). |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
This is not possible due to a bug in 6.5 which will be resolved in 7.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem CalculateOnBarClose = true in multipletimeframe strategy | azuul | Strategy Development | 13 | 05-27-2009 01:10 PM |
| DataSeries as Input for Indicator with CalculateOnBarClose = false | cbaer | Indicator Development | 1 | 01-14-2009 03:56 AM |
| what really happens when calculateonbarclose = false | verge | Strategy Development | 9 | 07-28-2008 01:50 AM |
| MACD CalculateOnBarClose=false | mwyatt | Indicator Development | 1 | 01-10-2008 09:31 AM |
| Indicator line goes to zero when CalculateOnBarClose set to True | ThePatientOne | Indicator Development | 1 | 08-30-2007 11:42 AM |