thankyou
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
Can I remove Fibonacci price levels?
Collapse
X
-
Can I remove Fibonacci price levels?
Can I remove the price levels so I only see the percentage without having to play with the code in Ninjascript as I am not keen to do that
thankyou1 PhotoTags: None
-
Hello Christopher Leggit,
Thanks for your question.
There would not be a way to remove the price levels without copying the Fibonacci Drawing tool and modifying it to change what text is shown.
Please let us know if you have any additional questions.Last edited by NinjaTrader_Jim; 11-16-2021, 07:40 AM.JimNinjaTrader Customer Service
-
Hi Jim,
Thank you for the quick reply, I had already had a good look and a fiddle with the 1000+ lines of code I saw a lot of "pricelevel" and commented out certain areas of code but it was removing the price and also the fib percentages. I've just gone over it another two times and accomplished the same. Could you point me in the right direction If I should aim my concentration at a certain area of the code.
I have edited CurrentOHL, PriorOHLC and the AWO Median to only show todays high as "TH" and so on. I'm using Add Plot Names indicator max margin of 200 the fib percentages would fit perfectly.
I'm not after the answer just a push in the right direction, having a crack at this is beyond beginners I just need to remove the price as it occasionally covers my pivots and others its very distracting.
Hope that's not to much
Thank you JimLast edited by Christopher Leggit; 11-16-2021, 11:37 AM.
Comment
-
Hello Christopher Leggit,
Sure thing. (I also moved this thread back to a NinjaScript Development forum. I did not realize you wanted to venture down this path when you opened your thread.)
Firstly, you will want to make a copy of the script (inside the code editor, Right Click > Save As) and then you will need to make each class copied unique. You may attempt compiling and use the compile errors to point out where the now duplicate classes are created so you can make them unique.
You will receive more compile errors after this, particular for the NinjaScript methods where they are implemented at line 1355 of FibonacciTools.cs (or now in your copy.)
public static partial class Draw...
You may comment this out and work on this later if you want to implement the NinjaScript drawing tool methods for your modified Drawing Tool.
Now that your copy is compiling, you can attempt some modifications.
DrawingTools use SharpDX for rendering and we want to look for TextLayouts that would be related to drawing the price level text. The string provided when the TextLayout is created will determine the message given.
In FibonacciRetracements, the TextLAyout is drawn on line 429:
RenderTarget.DrawTextLayout(new SharpDX.Vector2((float)drawAtX, (float)(y - textFormat.FontSize - edgePadding)), textLayout, priceLevel.Stroke.BrushDX, SharpDX.Direct2D1.DrawTextOptions.NoSnap);
textLayout is bolded and this is created on line 412:
SharpDX.DirectWrite.TextLayout textLayout = new SharpDX.DirectWrite.TextLayout(Core.Globals.Direct WriteFactory, str, textFormat, layoutWidth, textFormat.FontSize);
It is given the string str which is assigned a value on line 406:
string str = GetPriceString(price, priceLevel);
There is a friendly method used in the script called GetPriceString(). This is what you will need to modify and you may find the method on line 480:
private string GetPriceString(double price, PriceLevel priceLevel)
In this method, we can see priceStr contains the price, and then pct is added to the resulting string.
You can then blank out priceStr in order to remove the price portion from the price level text.
We look forward to assisting.JimNinjaTrader Customer Service
Comment
-
H Jim,
I commented out priceStr after using ); before it to close the string
I use retracements and extensions only, If what I have done here on line 485 for retracements is correct I have also done on line 857 For extensions and It has disabled the Fibonacci's from being drawn, I have tried different variations of "blanking/commenting/removing" areas within this method.
Last edited by Christopher Leggit; 11-16-2021, 08:56 PM.
Comment
-
Hello Christopher Leggit,
I had meant blank out, as in make the string blank.
If your modifications are causing the drawings to disappear, please check the log tab of the Control Center for errors that hint at where the problem is and what the problem is.
I can tell by looking at your code that you are using String.Format() with two elements, {0} and {1}, but you commented out the portion using priceStr, so only 1 element is given. This will produce a run time error
A publicly available resource on using String.Format() can be found here - https://www.c-sharpcorner.com/Upload...ng-in-C-Sharp/JimNinjaTrader Customer Service
Comment
-
Hi Jim,
It's been 11 days finally done.
After changing the classes so it would compile I was embarrassed to find what took me 11 days quite literally took 10 seconds
Thank you very much for the assistance and patience I had a brain operation when I was 21 coding is going to be a slow path for me.
I don't have short term memory loss so I wont end up asking the same questions in the future I do retain what I learn thankfully.
Thank you again Jim
Kind Regards
Christopher
Comment
-
Bellow is What I wanted to accomplish, I have changed each name in other indicators so when I use Add Plot Names it shows
I go off candlestick analysis so no need for the price plotted
todays current - TO,TL,TH
prior day - YO,YH,YL,YC
Median - 50%
and so on
maximum right side margin is 200 and I wouldn't want it any bigger
So the Fibonacci's fit perfectly
thank you Jim
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by helpwanted, Today, 03:06 AM
|
1 response
7 views
0 likes
|
Last Post Today, 03:35 AM | ||
Started by Brevo, Today, 01:45 AM
|
0 responses
7 views
0 likes
|
Last Post
by Brevo
Today, 01:45 AM
|
||
Started by aussugardefender, Today, 01:07 AM
|
0 responses
5 views
0 likes
|
Last Post Today, 01:07 AM | ||
Started by pvincent, 06-23-2022, 12:53 PM
|
14 responses
242 views
0 likes
|
Last Post
by Nyman
Today, 12:47 AM
|
||
Started by TraderG23, 12-08-2023, 07:56 AM
|
9 responses
384 views
1 like
|
Last Post
by Gavini
Today, 12:29 AM
|
Comment