private int lengthFast = 5; // Default setting for LengthFast int barsback = 500; //look back period int Var3 = -0.50; // -0.50 deviation double Var18 = TRIX(Var1, LengthFast).Default[0]; double Var22 = 1; Value2 = Var3 * StdDev(Var18, barsBack, Var22);
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
StdDev code help please
Collapse
X
-
StdDev code help please
Please help me understand why my StdDev code is incorrect for Value2.
Code:Tags: None
-
-
Originally posted by tradethebonds View PostPlease help me understand why my StdDev code is incorrect for Value2.
Code:private int lengthFast = 5; // Default setting for LengthFast int barsback = 500; //look back period int Var3 = -0.50; // -0.50 deviation [COLOR="Blue"][B]double Var18 [/B][/COLOR]= TRIX(Var1, LengthFast).Default[0]; double Var22 = 1; Value2 = Var3 * StdDev([COLOR="blue"][B]Var18[/B][/COLOR], barsBack, Var22);
Last edited by koganam; 04-10-2015, 12:08 PM.
Comment
-
Sorry...about that...
Var1 = EMA(EMA(( 3.14159155 * ( OPEN[0] + CLOSE[0] + HIGH[0] + LOW[0] )) / 4, 2), 5);
Comment
-
Hello,
Thank you for clarifying that. I'm running into another snag attempting to test the code. It appears that you are not passing in the correct parameters for the StdDev() indicator method. Can you please take a look at the help guide article below and advise me what you would like to pass in (either a period only, or a data series and a period)?
http://www.ninjatrader.com/support/h...ion_stddev.htm
I look forward to your reply.Dave I.NinjaTrader Product Management
Comment
-
-
Var1 would be the data series and a period of 500 bars back please, thanks very much!Last edited by tradethebonds; 04-13-2015, 07:36 AM.
Comment
-
Hello,
According to your previous post, it looks like Var1 is going to be a double:
Code:Var1 = EMA(EMA(( 3.14159155 * ( OPEN[0] + CLOSE[0] + HIGH[0] + LOW[0] )) / 4, 2), 5);
http://www.ninjatrader.com/support/h...ries_class.htm
http://www.ninjatrader.com/support/h...sic_syntax.htm
Please let know if I can assist further.Dave I.NinjaTrader Product Management
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by judysamnt7, 03-13-2023, 09:11 AM
|
4 responses
59 views
0 likes
|
Last Post
by DynamicTest
Today, 08:25 PM
|
||
Started by ScottWalsh, Today, 06:52 PM
|
4 responses
36 views
0 likes
|
Last Post
by ScottWalsh
Today, 07:40 PM
|
||
Started by olisav57, Today, 07:39 PM
|
0 responses
7 views
0 likes
|
Last Post
by olisav57
Today, 07:39 PM
|
||
Started by trilliantrader, Today, 03:01 PM
|
2 responses
21 views
0 likes
|
Last Post
by helpwanted
Today, 07:25 PM
|
||
Started by cre8able, Today, 07:24 PM
|
0 responses
10 views
0 likes
|
Last Post
by cre8able
Today, 07:24 PM
|
Comment