PDA

View Full Version : NT7 b20 Pivots do not return values


Operandi
08-15-2010, 06:02 AM
There seems to be a bug in that pivots do not return values in strategies using NT7 b20. This was also apparent in b19.

The example from the manual returns 0 for this code:

double value = Pivots(PivotRange.Daily, HLCCalculationMode.DailyBars, 0, 0, 0, 20).S2[0];
Print("The current Pivots S2 pivot value is " + value.ToString());

Also only one set of pivots is displayed on the chart even if both daily and weekly pivot indicators are applied.

Thanks
Chris

NinjaTrader_Bertrand
08-16-2010, 07:41 AM
Chris, which datafeed are you using here? It the call working as expected for you if the Calculation Mode is set to CalcFromIntradayData?

Thanks

Operandi
08-16-2010, 09:19 AM
Hi Bertrand

I am using this with market replay data, which had been downloaded from IB. Using CalcFromIntradayData works fine so that the problem lies with calc from daily bars, however I am now wondering if this is because i haven't got daily bar data recorded.

Chris

NinjaTrader_Bertrand
08-16-2010, 09:54 AM
Correct, you would need native daily historical data in this case - if you try a regular chart connected to a IB live account, would the values calc as expected?

Harry
08-25-2010, 03:22 PM
Probably the same problem that I have reported here:

http://www.ninjatrader.com/support/forum/showpost.php?p=186344&postcount=28

Operandi
08-26-2010, 12:27 AM
Weekly calculated pivots don't return a value either when connected to live Kinetick (EOD) and IB data feeds

NinjaTrader_Bertrand
08-26-2010, 05:04 AM
We could reproduce an issue here guys with the programmatic pivot calling - we're currently looking into and will provide an update shortly.

Harry
10-05-2010, 09:39 AM
Is there any news on this? I want to call the pivot values via another indicator in DailyBars mode. Last time I tried this the values returned were 0.

So I ended up integrating the whole pivot indicator into the code of the other indicator. But I would really be happy to know how to call those values.

NinjaTrader_Bertrand
10-05-2010, 09:55 AM
Harry, we looked into matters and by the way the pivots indicator is working the additional series are loaded asynchronous, as they would be needed in the given scenario - thus it's important to add a check it would offer valid plot values already when programmatically working with it, we added a new reference sample for this case -

http://www.ninjatrader.com/support/forum/showthread.php?t=33061

Harry
10-05-2010, 10:21 AM
Thank you for the help. I will try it out.

Harry
10-24-2010, 01:51 AM
I have now followed the best practice of the reference sample, but there is still a problem. If I use an indicator that references the pivots indicator in DailyBars mode, this indicator will often display nothing. To activate the indicator I have to apply it to a chart and then Reload NinjaScript in a second step (F5).

Same indicator in CalcFromIntradayData mode works immediately without the need to reload NinjaScript.

I am afraid that the indicator, if used in any strategy does not work correctly.

Any suggestions?


Harry, we looked into matters and by the way the pivots indicator is working the additional series are loaded asynchronous, as they would be needed in the given scenario - thus it's important to add a check it would offer valid plot values already when programmatically working with it, we added a new reference sample for this case -

http://www.ninjatrader.com/support/forum/showthread.php?t=33061

NinjaTrader_Austin
10-24-2010, 01:50 PM
Harry, I will have Bertrand get back to you tomorrow.

Harry
10-24-2010, 03:27 PM
Thank you for your answer. I have further problems with this:

When accessing an indicator in DailyBars mode and not connected -> works!
When accessing an indicator in DailyBars mode and connected -> does not work!

Applies to single connections EOD only, single connection intraday and EOD, or double connections.

In DailyBars mode the indicator does not return values as expected and nothing is displayed, although I used the model indicator.

Harry, I will have Bertrand get back to you tomorrow.

Harry
10-24-2010, 05:40 PM
I have coded a small sample indicator, which tries to access the NinjaTrader pivots indicator in DailyBars mode.

If NinjaTrader is not connected -> pivot lines are retrieved and displayed by sample indicator.

As soon as I connect NinjaTrader -> pivot lines cannot be displayed, as the sample indicator does not work.

Sometimes it works when connected, after hitting F5 three of four times.

Indicator is attached. Thanks for confirming the problem.

NinjaTrader_Bertrand
10-25-2010, 10:12 AM
Harry, thanks for providing the snippet - looking into it now.

Harry
10-27-2010, 12:12 PM
Harry, thanks for providing the snippet - looking into it now.

Hi Bertrand, could you reproduce the problem?

NinjaTrader_Josh
10-27-2010, 02:23 PM
This is simply a race condition for the async nature of the scenario you have. When you are connected the loading of data is simply not fast enough to be done before the calculations thus you end up with 0 as your values. When you are not connected and everything is off the repository it is able to grab values earlier and actually get that done for some historical bars. It is simply not fast enough to be able to grab it for historical bars when connected, but it will work on real-time events that come up afterwards once everything gets done.

Harry
10-27-2010, 03:20 PM
How shall I handle that? I know three other traders who have a problem with this specific issue, strategies not running, charts not being displayed. What would you suggest to make it work?

This is simply a race condition for the async nature of the scenario you have. When you are connected the loading of data is simply not fast enough to be done before the calculations thus you end up with 0 as your values. When you are not connected and everything is off the repository it is able to grab values earlier and actually get that done for some historical bars. It is simply not fast enough to be able to grab it for historical bars when connected, but it will work on real-time events that come up afterwards once everything gets done.

NinjaTrader_Josh
10-27-2010, 03:51 PM
An easy way to beat the async nature of things is pushing the scenario to be a more "synced" scenario by using HLCCalculationMode.CalcFromIntradayData instead.

Harry
10-28-2010, 04:51 AM
I am aware of this, but this results in false pivots, as the settlement price is only available from daily data. So how can I access the correct pivots in DailyBars mode? Besides, I have a number of other indicators that use daily data and suffer from the same problem.

An easy way to beat the async nature of things is pushing the scenario to be a more "synced" scenario by using HLCCalculationMode.CalcFromIntradayData instead.

NinjaTrader_Bertrand
10-28-2010, 05:01 AM
Harry, one way would be using a Pivots indicator that uses the MultiSeries concept, thus not running into the async series loading issues.