Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
Normal Distribution
Collapse
X
-
Normal Distribution
Hi everyone , i'm trying to create an indicator that plot a log normal distribution of price , but the problem is when i imported the meta numerics library , i couldn't know where to begin . please if you have some ideas , let me know . thanks .Tags: None
-
Hello tarikghost,
While using this 3rd party library would be outside of what is supported by NinjaTrader Support, there are some general steps for using a dll.
Usually the dll is added to the Documents\NinjaTrader 7\bin\Custom folder.
Then a reference is added in NinjaTrader.- Right click in the code section of the NinjaScript editor.
- In the context menu click on ‘References’.
- In the Reference dialog, Click on the ‘Add’ button.
- Select the DLL and then click ‘Ok’.
- Compile the indicator now by pressing F5.
Please also see the section “How to add a reference” from our help guide
After the reference is added, generally a using statement is included in the using region of the script.
Below is a publicly available link to the installation page for meta numerics.
https://metanumerics.codeplex.com/wi...=DocumentationChelsea B.NinjaTrader Customer Service
-
Thanks Chelsea B , in fact all what you have mentionned is true and i did it before , my question is how can we PLOT a normal distribution of price .
Comment
-
Hello tarikghost,
If you have a number value and you want to plot this, you can do this from an indicator in NT7.
To add a plot to your script:
Add(new Plot(Color.Blue, "MyPlot"));
http://ninjatrader.com/support/helpGuides/nt7/add.htm
To set a plot on a bar with a variable:
int aValue = 99
Value.Set(aValue);
http://ninjatrader.com/support/helpGuides/nt7/value.htmChelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by tarikghost View PostThanks Chelsea B , in fact all what you have mentionned is true and i did it before , my question is how can we PLOT a normal distribution of price .
Of course, you can apply a Fisher Transform, which has been demonstrated to make any non-constant distribution to become approximately Gaussian.
I am presuming here that by "normal distribution", you are referring to a "Gaussian distribution".
ref: https://en.wikipedia.org/wiki/Fisher_transformation
Comment
-
Thanks Koganam for your reply , actually my purpose is to choose an interval on wich i could plot some bars of price close using lognormal distribution .
My problem now is when a declare a variable Interval intrv , and want to set my intrv leftend point and rightend point it doesn't work ; it shows this error message :" Property or indexer 'Meta.numerics.interval.LeftEndpoint' cannot be assigned to -- it is read only"
Interval intrv ;
else if (State == State.Configure)
{
intrv.LeftEndpoint = 2 ;
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
Print("Interval: " +intrv.LeftEndpoint ) ;
}
}
Comment
-
it didn't work Chelsea B unfortunately :/ , it says 'Meta.Numeric.Interval' doesn't contain a definition for 'LeftEndpoint' .
Comment
-
Hello tarikghost,
I wouldn't know for sure, but you may need to use the full namespace.
Interval intrv;
intrv = new Interval() { Meta.Numerics.Interval.LeftEndPoint = 2 };
(Also, it may be read only in the library class meaning that it has a get and not a set for that property, I wouldn't be able to say)
You might look to see if there is an overload parameter in the constructor that allows this to be passed in.Chelsea B.NinjaTrader Customer Service
Comment
-
Originally posted by tarikghost View PostThanks Koganam for your reply , actually my purpose is to choose an interval on wich i could plot some bars of price close using lognormal distribution .
My problem now is when a declare a variable Interval intrv , and want to set my intrv leftend point and rightend point it doesn't work ; it shows this error message :" Property or indexer 'Meta.numerics.interval.LeftEndpoint' cannot be assigned to -- it is read only"
Interval intrv ;
else if (State == State.Configure)
{
intrv.LeftEndpoint = 2 ;
}
}
protected override void OnBarUpdate()
{
//Add your custom indicator logic here.
Print("Interval: " +intrv.LeftEndpoint ) ;
}
}
This is the first time I have ever looked at that library and already I see that to define an interval, as the manual says: "Use the static methods FromEndpoints(Double, Double), FromMidpointAndWidth(Double, Double), and FromEndpointAndWidth(Double, Double) to instantiate intervals."
You may want to read the documentation to find out what you can do and how to do it.
Comment
-
Thanks koganam for your reply , actually i didn't find that static method that they are talking about in documentation unfortunatly , it generates that it doesn't exist . if it's possible to generate an interval in your ninjatrader , and share your code , i would appreciate it .
Comment
-
Ohh finaly i figure it out ,
Interval intrv ;
intrv = Interval.FromEndpoints(-1,1);
Print("intrv " + intrv ) ;
Thank you guys you are awesome : Chelsea _B and koganam i appreciate your help .
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by kujista, Today, 06:23 AM
|
0 responses
1 view
0 likes
|
Last Post
by kujista
Today, 06:23 AM
|
||
Started by traderqz, Yesterday, 04:32 PM
|
1 response
11 views
0 likes
|
Last Post Today, 06:14 AM | ||
Started by f.saeidi, Today, 05:56 AM
|
1 response
4 views
0 likes
|
Last Post
by Jltarrau
Today, 06:00 AM
|
||
Started by Jltarrau, Today, 05:57 AM
|
0 responses
4 views
0 likes
|
Last Post
by Jltarrau
Today, 05:57 AM
|
||
Started by Stanfillirenfro, Yesterday, 09:19 AM
|
7 responses
53 views
0 likes
|
Last Post Today, 05:31 AM |
Comment