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!
See more
See less

Partner 728x90

Collapse

how to update/recalculate/display plots without OnBarUpdate()

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    #16
    Originally posted by rare312 View Post

    hello. Did you check those [Vertical Line All Panels Drawing Tool] I've linked to? You will find the code how to do it.
    Hi 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.

    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

    Comment


      #17
      Originally posted by sidlercom80 View Post
      Hi 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.
      I don't work like that. Besides, you will be much more pleased to try to do it yourself.
      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

      Click image for larger version

Name:	MarkerNT8.png
Views:	231
Size:	66.3 KB
ID:	1211004

      Comment


        #18
        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.​

        Click image for larger version  Name:	2022-11-09_204341.png Views:	0 Size:	6.9 KB ID:	1222949Click image for larger version  Name:	2022-11-09_193717.png Views:	0 Size:	5.8 KB ID:	1222950
        Last edited by FatCanary; 11-09-2022, 03:01 PM.

        Comment


          #19
          Originally posted by FatCanary View Post
          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.​

          Click image for larger version Name:	2022-11-09_204341.png Views:	0 Size:	6.9 KB ID:	1222949Click image for larger version Name:	2022-11-09_193717.png Views:	0 Size:	5.8 KB ID:	1222950
          Hi. Was glad to help ) As far as I remember, I had the same results. But my point was to draw right after the Axis line. I don't like this default markers overlapping.
          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#post1132034
          Last edited by rare312; 11-09-2022, 07:09 PM.

          Comment


            #20
            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


              #21
              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 Tim-c
              by Tim-c
               
              Started by FrancisMorro, Today, 03:24 AM
              0 responses
              2 views
              0 likes
              Last Post FrancisMorro  
              Started by Segwin, 05-07-2018, 02:15 PM
              10 responses
              1,772 views
              0 likes
              Last Post Leafcutter  
              Started by Rapine Heihei, 04-23-2024, 07:51 PM
              2 responses
              31 views
              0 likes
              Last Post Max238
              by Max238
               
              Started by Shansen, 08-30-2019, 10:18 PM
              24 responses
              945 views
              0 likes
              Last Post spwizard  
              Working...
              X