Announcement
Collapse
Looking for a User App or Add-On built by the NinjaTrader community?
Visit NinjaTrader EcoSystem and our free User App Share!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less
Partner 728x90
Collapse
NinjaTrader
Indicators work by themselves, not when nested
Collapse
X
-
Indicators work by themselves, not when nested
I have two indicators I converted to NT8 from NT7. They seem to work by themselves, comparing to NT7. The problem is when I use one indicator as the input for the other. What could the possible issue be? I have scoured the code and can't find anything. I changed the prices series in the relevant indicators as Input rather than Close.Tags: None
-
Hello ericson,
Have you added any prints to your script to ensure the data in is the same?
Are you finding that each bar prints the same price for the price series you are using in the calculations?
Do you have multiple series in the script?
Are you able to reproduce this behavior using NinjaTrader system indicators?Chelsea B.NinjaTrader Customer Service
-
Have you added any prints to your script to ensure the data in is the same?
No
Are you finding that each bar prints the same price for the price series you are using in the calculations?
N/A
Do you have multiple series in the script?
Yes i think
Are you able to reproduce this behavior using NinjaTrader system indicators?
No just the converted indicators
Comment
-
Hello ericson,
You will need to add prints to your script and ensure you are using the same data.
Below is a link to a video that demonstrates using prints to understand behavior.
Please print the value of each bar with a timestamp and provide the output for both NT7 and NT8.
You mention that you are using a secondary series in the script with AddDataSeries(). Have you ensured that any added series in the hosted script is also added to the host script?
From the help guide:
"Should your script be the host for other scripts that are creating indicators and series dependent resources in State.DataLoaded, please make sure that the host is doing the same AddDataSeries() calls as those hosted scripts would. For further reference, please also review the 2nd example below and the 'Adding additional Bars Objects to NinjaScript' section in Multi-Time Frame & Instruments"
AddDataSeries() - http://ninjatrader.com/support/helpG...dataseries.htm
Multi-Time Frame & Instruments - http://ninjatrader.com/support/helpG...tToninjascriptChelsea B.NinjaTrader Customer Service
Comment
-
Is it possible to send the indicators to customer service privately to find the problem?
Repaints means as new bars built the plot changes for the period in which the indicator was set. Historical bars before the period is set though.
Output plot is "1" the entire chart, moves fractions from 1.
Not using onrender or another dataseries.
Indicators compatible with NT8Last edited by ericson; 02-01-2017, 03:11 PM.
Comment
-
Hello ericson,
The NinjaTrader Platform Support can be reached by emailing platformsupport [at] ninjatrader [dot] com.
Below I am linking the contact page for NinjaTrader.
If you have any questions, concerns or feedback, or want to open an account, we're here to help. Click here to find the appropriate contact for your needs!
I'm not quite understanding the behavior you are describing.
Are you saying that the script will retroactively set plot values for historical bars (changing the historical values after those bars have passed)?
If both scripts do this, perform the same calculations, and both change the values of pltos historically the same, the values should still be the same.
Until you know the data is the same, it wouldn't be possible to tell as the different data would cause different values and you would not be able to tell if the calculation is correct.
Have you added any prints to either script to ensure the data is the same?
May we have the output that has appeared in the output window so that we may assist in analyzing the output?Chelsea B.NinjaTrader Customer Service
Comment
-
First indicator (not used at input), while second indicator is used as input. Refreshed ninjascript on chart.
Code:if (CurrentBar == 0) {return;} numerator[0] = (Input[0] - SMA(Input, Range)[0]); denominator[0] = (StdDev(Input, Range)[0]); if//(denominator[0]<0.000000000001 && denominator[0]>-0.000000000001) //(denominator[0].CompareTo(0) == 0)// Check to make sure you are not dividing by zero (denominator[0] == 0)// Check to make sure you are not dividing by zero {Z[0] = (CurrentBar == 0 ? 50 : Z[1]);} else {Z[0] = (numerator[0] / denominator[0]); Print("Bar "+CurrentBar.ToString()+" :"+Z[0].ToString());
Attached FilesLast edited by ericson; 02-02-2017, 06:53 AM.
Comment
-
Second Indicator used as input to first. The loop changes the number several times. Had to only get the first number in the loop. File too big. Snippet of code:
Code:for(n=i0;n<=i0+p;n++) { sum=0; for(kk=1;kk<=degree;kk++) { sum+=x[kk+1]*Math.Pow(n,kk); } Fx[n] = (x[1]+sum);//n if(Fx[n] == Fx[0]) {Print("Bar "+CurrentBar.ToString()+" :"+Fx[0].ToString());} }
Attached FilesLast edited by ericson; 02-02-2017, 06:54 AM.
Comment
-
Here is the output of the indicators separated.
Comment
-
These are outputs in NT7, which work, Indicator 2 is input for indicator 1. Used same data series time frame.Last edited by ericson; 02-02-2017, 07:10 AM.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by alexkoe, Today, 05:59 AM
|
1 response
6 views
0 likes
|
Last Post Today, 08:13 AM | ||
Started by kaywai, Today, 12:06 AM
|
1 response
15 views
0 likes
|
Last Post Today, 08:01 AM | ||
Started by Padan, Today, 02:02 AM
|
1 response
10 views
0 likes
|
Last Post Today, 07:56 AM | ||
Started by Mestor, Today, 03:15 AM
|
1 response
8 views
0 likes
|
Last Post Today, 07:41 AM | ||
Started by RaygunWizzle, Yesterday, 08:52 PM
|
1 response
9 views
0 likes
|
Last Post Today, 07:40 AM |
Comment