![]() |
This website will be down for maintenance from Friday May 24th at 6PM MDT until Saturday May 25th at 11AM MDT. We apologize for the inconvenience. If you need assistance during this time, please email sales@ninjatrader.com
|
|||||||
| Indicator Development Support for the development of custom indicators using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Senior Member
Join Date: Apr 2008
Posts: 164
Thanks: 2
Thanked 3 times in 3 posts
|
Hi,
I have a multi timeframe indicator, the Bars are 5m, 30m, 60m. Most of the calculation is done on the 5m. I have a custom DataSeries synced to the 5m (BarsArray[0]). If I set a value into the DataSeries (for a signal for example) in BarsInProgress==0, it is remembered just fine UNLESS this bar's timestamp coincides with a bar in another timeframe. So on the half hour and on the hour, the DataSeries forgets its value. I programmed a variable to remember the value and set it again from the higher timeframes, (which are executed after BarsArray[0]) however DataSeries.Set(value) doesn't seem to work from a timeframe other than the one the DataSeries is synced to. So I currently have no workaround for this problem. Suggestions please? Thanks, saltminer |
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Hi saltminer, what do you mean by 'forget' it's value - what value are you getting printed for this 'conflict' bar then?
Would you have a sample of code I could check into here?
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Senior Member
Join Date: Apr 2008
Posts: 164
Thanks: 2
Thanked 3 times in 3 posts
|
HI Bertrand,
I have emailed you some code. The value is 'forgotten' by being set to the bar's Close price, which is what happens for a DataSeries if Set() is not used during an OnBarsUpdate(). Cheers, saltminer |
|
|
|
|
|
#4 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Ok got it Saltminer, will take a look shortly.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,414
Thanks: 252
Thanked 978 times in 961 posts
|
Replied via email directly saltminer.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#6 | |
|
Senior Member
Join Date: Apr 2008
Posts: 164
Thanks: 2
Thanked 3 times in 3 posts
|
Hi Bertrand,
thank you for taking the time to run my code. Yes, the signal remains only for a single bar. However, the signal at ten minutes past the hour is not a test of the problem. If the signal occurs at a time when there is also a bar on another timeframe, for instance at the hour or the half-hour, then the value in the signals dataseries does not remain. it gets changed to the Closing price of the bar. I have gotten around it by creating a public double value, which will remember a value I set to it, but the overall principle of multi-timeframe indicators is going to be very difficult to use if a simultaneous OnBarsUpdate from another timeframe is going to obliterate any data generated in the principle timeframe. Cheers, saltminer Quote:
|
|
|
|
|
![]() |
| Tags |
| dataseries, indicator, multitimeframe |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Referencing DataSeries with multi timeframe indicators | trader2be | General Programming | 5 | 01-06-2011 06:35 AM |
| Dataseries problem in Multi-timeframe strategy | bridenour | Automated Trading | 2 | 07-25-2009 05:06 AM |
| Multi timeframe dataseries | astrolobe | Strategy Development | 1 | 06-17-2009 05:47 AM |
| Accessing Multi Timeframe Indicator Values | TAJTrades | Indicator Development | 11 | 03-02-2009 07:11 AM |
| indicator values multi vs single timeframe | ceesvh | Strategy Development | 3 | 09-19-2007 09:11 PM |