Thanks for your help.
Announcement
Collapse
No announcement yet.
Partner 728x90
Collapse
NinjaTrader
PriceLevels.Add() Docs? Specifically to how to add or define custom pricelevels.
Collapse
X
-
PriceLevels.Add() Docs? Specifically to how to add or define custom pricelevels.
I found the function/method PriceLevels.ADD() in FibonacciTools. There is a way to modify a PriceLevel defined in GannFan return object documentation. I can't seem to find specific documentation on how to use PriceLevels other than to get at the price at the level in the tool.
Thanks for your help.Tags: None
-
Hello MartinT,
Thanks for the post.
To start there is no documentation for this topic, really this would rely on a strong understanding of C# object oriented programming which will give a better understanding of how the price levels work and are organized in the existing script.
The price levels can be changed or more properties like that can be created, you would first need to create a new tool from the existing tool by doing a Save As.
Depending on what you want to change you may just need to create a new drawing tool that sets new defaults or adds custom levels. That would involve duplicating the GannFan class and then modifying the loop which sets the levels in OnStateChange.
If you wanted to do more radical changes there is a sample of the GannFan which demonstrates the changes needed to make a completely new tool with custom levels or properties: https://ninjatrader.com/support/foru...884#post743884
I look forward to being of further assistance.
JesseNinjaTrader Customer Service
-
Hi Jesse,
Thank you for your Post. I tried using PriceLevels.ADD(...) in my simple script just after the calle to Fibonacci.Retracement(...) It actually worked very well but I did see some minor issues. The text for my added levles was a bit different and the perfomance seemed compared to manually placing the FibRetracement. But the performance issue may be my fault about where I placed it in my script. That lead me to think maybe it isn't documented for a reason.
I added 14.58 and 85.42 levels in my script with this snipet:
Code:FibonacciRetracements myFibDown = Draw.FibonacciRetracements(this, ProcDescript + "FibRetrace_Down", false, myTrends[1].RootBarsBack, myTrends[1].RootPrice, myTrends[0].RootBarsBack, myTrends[0].RootPrice); myFibDown.PriceLevels.Add(new PriceLevel(14.58, Brushes.DodgerBlue)); myFibDown.PriceLevels.Add(new PriceLevel(85.42, Brushes.SeaGreen));
OR
Instead of modifying your FibonacciTools to add additional pricelevel, wouldn't it be much simpler to create a template(from within Drawing Objects...) and use the overload that calls Fibonacci.Retracements with the template parameter? I only want to change/modify are the pricelevels. I think that should work. ( I added this part for other readers looking for the same flexiblity)
I only just now figured out I could use a template to solve this.
thank you for your help,
Comment
-
Hello MartinT,
Thanks for clearing up the use case, you can ignore the last message. If you are using a drawing object and wanted to just add to that objects existing levels what you provided would work. You would need to only do that Once when you first draw the object, if you call this over and over it will create many levels and lead to poor performance. You would have to do something like store the object to a variable when you create it and use that to delegate when you call Add().
You can also use a template if you just wanted to define some levels that are always used, thats another valid option that does not require scripting.
I look forward to being of further assistance.JesseNinjaTrader Customer Service
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
938 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
||
Started by Max238, Today, 01:28 AM
|
0 responses
3 views
0 likes
|
Last Post
by Max238
Today, 01:28 AM
|
||
Started by rocketman7, Today, 01:00 AM
|
0 responses
1 view
0 likes
|
Last Post
by rocketman7
Today, 01:00 AM
|
||
Started by wzgy0920, 04-20-2024, 06:09 PM
|
2 responses
27 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:43 PM
|
||
Started by wzgy0920, 02-22-2024, 01:11 AM
|
5 responses
32 views
0 likes
|
Last Post
by wzgy0920
Yesterday, 10:33 PM
|
Comment