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
how to update/recalculate/display plots without OnBarUpdate()
Collapse
X
-
Originally posted by rare312 View Post
-
Originally posted by sidlercom80 View PostHi rare312, yes I looked at the example, unfortunately I can not see a price marker! I see only the line. I can not see in the example code how to create a price marker in the price scale, please give me a code snippet of it, thank you.
The example I was talking about makes it possible to draw a line on all chart panels. There is no such possibility by default, but they used some kind of trick (in OnRender method)
/*----------*/
if (!IsInHitTest)
{
RenderTarget.PopAxisAlignedClip();
RenderTarget.PushAxisAlignedClip(/*Your code-1*/);
// Your Drawing code.....
// ............
RenderTarget.PopAxisAlignedClip();
RenderTarget.PushAxisAlignedClip(/*Your code-2*/);
}
/*----------*/
Use the same trick to draw what you want on the price panel.
If it's hard to figure it out, search SharpDX library on github for explanations/examples. That's everything i can help you.
And here is how it looks like in my case
- Likes 2
Comment
-
Hi rare312
Thanks to you I have been able to draw in the price margin. Many thanks.
Have you found a way of drawing over the margin border?
By default, SharpDX geometries are placed over the price text, but not the margin border.
In the second screenshot, you can see the line of the border is drawn in front of my geometry.
Last edited by FatCanary; 11-09-2022, 03:01 PM.
Comment
-
Originally posted by FatCanary View PostHi rare312
Thanks to you I have been able to draw in the price margin. Many thanks.
Have you found a way of drawing over the margin border?
By default, SharpDX geometries are placed over the price text, but not the margin border.
In the second screenshot, you can see the line of the border is drawn in front of my geometry.
Also, I don't want the markers to hide information from indicators like level 2. As well as I don't want to move the indicators to the left of the chart because of markers.
In my opinion, the marker should be at the price field only. As it was in NT7
I don't know how to help in your case. And I'm not sure it's possible by using sharpDX drawings. The Axis is simply higher layer.
I did use userControl Collection and Windows.Controls before.
So it was higher: https://ninjatrader.com/support/foru...34#post1132034Last edited by rare312; 11-09-2022, 07:09 PM.
Comment
-
Many thanks for the reply.
I was hoping that RenderTarget had a ZOrder, but it appears that it doesn't. Unfortuantely, good documentation for SharpDX (outside of NT's docs) is difficult to find.
It is possible to draw over the axis line; I've seen it done in a proprietary indicator.
My next step was to look at a UserControl. So, thanks for that information.Last edited by FatCanary; 11-10-2022, 05:21 AM.
Comment
-
I finally figured it out.
Using SharpDX to render in the price axis will paint 'under' the axis border. Instead we need to use a plot to get a price marker, as has been previously mentioned.
The trick to get the price marker to update 'instantly' is to use TriggerCustomEvent(), Using TiggerCustomEvent to update a previously set custom Series<T> value, and, in my case, in the mouse move event use ChartControl.InvalidateVisual() to force an OnRender() refresh.
Be aware that calling InvalidateVisual() may cause higher rendering times.
Comment
Latest Posts
Collapse
Topics | Statistics | Last Post | ||
---|---|---|---|---|
Started by Tim-c, Today, 03:54 AM
|
0 responses
3 views
0 likes
|
Last Post
by Tim-c
Today, 03:54 AM
|
||
Started by FrancisMorro, Today, 03:24 AM
|
0 responses
2 views
0 likes
|
Last Post
by FrancisMorro
Today, 03:24 AM
|
||
Net Change
by Segwin
Started by Segwin, 05-07-2018, 02:15 PM
|
10 responses
1,772 views
0 likes
|
Last Post
by Leafcutter
Today, 03:01 AM
|
||
Change colour of Stop market and limit orders to red and green via indicator script
by Rapine Heihei
Started by Rapine Heihei, 04-23-2024, 07:51 PM
|
2 responses
31 views
0 likes
|
Last Post
by Max238
Today, 02:25 AM
|
||
Started by Shansen, 08-30-2019, 10:18 PM
|
24 responses
945 views
0 likes
|
Last Post
by spwizard
Today, 01:29 AM
|
Comment