![]() |
|
|||||||
| Strategy Development Support for the development of custom automated trading strategies using NinjaScript. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 |
|
Member
Join Date: Dec 2008
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Can someone please explain why I see value differences between a value returned when an indicator is called inside of a strategy and the value that can be seen when the same indicator is drawn on a chart?
Here's the code in the strategy: psar = ParabolicSAR(psar_front,psar_middle,psar_back).Val ue[1]; I use the fist bar back as I'm calling this from the First Tick of Bar. (the [0] bar returns "0") The values returned in this example are (see File1): ToTime Vstrat ~Vchart 10000 3859.88 3875.0 10500 3863.71 3879.5 11000 3867.35 3883.0 11500 3870.81 3887.0 12000 3874.09 3890.5 12500 3877.21 3894.5 13000 3880.18 3892.0 The value calculated in the strategy (Vstrat) seems like it is shifted in value to the value shown in the chart (~Vchart) or the other way around. Funny thing is if I stop running the strategy and open the indicator dialog box and hit "apply" the chart goes to the strategy-calculated values shifted by one bar. See File2. I have the same problem with other indicators: the value returned to my strategy is different than what is simultaneously drawn on a chart. This obviously makes building strategy logic difficult as the painted indicator is not what is being internalized in the strategy. Thanks! Larry
Last edited by epcompany; 06-15-2009 at 10:53 PM.
|
|
|
|
|
|
#2 |
|
NinjaTrader Customer Service
Join Date: Sep 2008
Location: Germany
Posts: 22,569
Thanks: 262
Thanked 1,018 times in 999 posts
|
Larry, thanks for the post - please make sure you run the latest 6.5.1000.11 release version of NinjaTrader - this also contains the fixed ParabolicSAR indicator ('ParabolicSARFixed'), I would suggest retrying your strategies with this one then.
Bertrand
NinjaTrader Customer Service |
|
|
|
|
|
#3 |
|
Member
Join Date: Dec 2008
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Bertrand,
Thanks for the advice. However, I was using version 1000.9 and updated to both versions 1000.10 and 1000.11. The file you reference, ParabolicSARFixed, was not in either the .10 or .11 release. The file, @ParabolicSAR.cs dated 4/27/09, was identical in all three versions. I even discarded the NinjaTader folder and did a completely new install with the old file being the one that showed up. I noted that the release notes say that the new ParabolicSAR was released with 1000.10. It doesn't seem to be. Is there an alternate place where NT keeps these files, like somewhere on the forum? Thanks, Larry |
|
|
|
|
|
#4 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Larry,
As you reinstall have you tried deleting your My Documents\NinjaTrader 6.5 folder? You will lose everything when you do that and you will get a fresh reinstall. Please beware that it clears everything out when you do this so backup anything you want to keep beforehand.
Josh
NinjaTrader Customer Service |
|
|
|
|
|
#5 |
|
Member
Join Date: Dec 2008
Posts: 61
Thanks: 0
Thanked 0 times in 0 posts
|
Josh,
As I said in the previous response to Bertrand, "I even discarded the NinjaTader folder and did a completely new install with the old file being the one that showed up." So, yes I have done what you suggest. As the problem seems to be nothing more than my needing the new .cs file for the ParabolicSAR, where else might I get it. Thanks, Larry |
|
|
|
|
|
#6 |
|
NinjaTrader Product Manager
Join Date: May 2007
Location: Denver, CO
Posts: 17,458
Thanks: 1
Thanked 107 times in 70 posts
|
Larry,
You have the new file if you have installed NinjaTrader 6.5.1000.10 or up. I have attached it here again for you anyways. Please replace your file and see if it works.
Josh
NinjaTrader Customer Service |
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Difference btw Strategy on Charts & Strategy Tabs | tjendra | Automated Trading | 5 | 05-13-2009 08:46 AM |
| How do I enable/disable order indication | hanzahar | Charting | 1 | 12-20-2008 07:59 PM |
| hist. data difference chart vs strategy analyser | nico_p | Strategy Analyzer | 3 | 03-26-2008 04:36 AM |
| Curious about difference loading data for chart vs strategy | Pete S | Historical NinjaTrader 6.5 Beta Threads | 3 | 03-19-2008 12:43 AM |
| Difference between strategy run on Chart and one run from Control Center | richa61416 | Strategy Analyzer | 6 | 09-23-2007 05:07 AM |