Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Add a self-created price marker

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

    Add a self-created price marker

    Hi, i would like to add a price marker to the line generated in onRender(), just like the orderlines in the charttrader. is this possible? how would i have to create the price marker directly in the strategy or a drawing tool or indicator? what would be the best solution for this? second question would be how to move the line with the mouse, i would like to recreate the same functions as in charttrader. maybe someone here has a tip on how I can best work on the implementation ;-)

    Click image for larger version

Name:	Screenshot_2.jpg
Views:	110
Size:	14.6 KB
ID:	1130407Click image for larger version

Name:	Screenshot_3.jpg
Views:	90
Size:	15.6 KB
ID:	1130408

    #2
    Hello sidlercom80,

    Thank you for your post.

    I'd probably recommend using a drawing tool - the below Labeled Lines Drawing Tool add-on from our publicly available User App Share would be a good place to start:

    https://ninjatraderecosystem.com/use...-drawing-tool/

    If you want to make the label look different, you can use PathGeometry to make something that looks more like the Chart Trader price markers.

    https://ninjatrader.com/support/help...thgeometry.htm

    As far as capturing mouse events to create a click/drag functionality, that would be primarily out of the NinjaScript realm of support and more into C#, but there's useful information on this post that should help you get started:

    https://ninjatrader.com/support/foru...380#post803380

    Please let us know if we may be of further assistance to you.

    The NinjaTrader Ecosystem website is for educational and informational purposes only and should not be considered a solicitation to buy or sell a futures contract or make any other type of investment decision. The add-ons listed on this website are not to be considered a recommendation and it is the reader's responsibility to evaluate any product, service, or company. NinjaTrader Ecosystem LLC is not responsible for the accuracy or content of any product, service or company linked to on this website.
    Kate W.NinjaTrader Customer Service

    Comment


      #3
      Hi _Kate thank you for your post,

      when the mouse pointer is in the rectangle and the left mouse button is pressed, an action is executed. that fits so far, but how can i prevent that when moving the mouse with pressed mouse button, the chart is not moved? is there something like chartControl.IsEnabled = false; that would work here? if the conditions are fulfilled, switch off chart moving ( chartControl.IsEnabled = false) and switch it on again with (chartControl.IsEnabled = true).

      Comment


        #4
        Hello sidlercom80,

        Thank you for your reply.

        There are no documented NinjaScript methods for this and this would require custom C# coding.

        You might add a handler to the PreviewMouseDown event to detect the chart has been clicked on and instead of the default logic, execute your own logic for clicking and dragging.

        Below is a link to an indicator example that uses this.
        https://ninjatrader.com/support/foru...624#post792624

        Please let us know if we may be of further assistance to you.
        Kate W.NinjaTrader Customer Service

        Comment


          #5
          Hi _Kate, thank you for the tip with "PreviewMouseDown", it was very helpful ;-)

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by MidenThur, Today, 12:52 AM
          0 responses
          5 views
          0 likes
          Last Post MidenThur  
          Started by seseoraf, Today, 12:51 AM
          1 response
          5 views
          0 likes
          Last Post charmingishagarg  
          Started by Rosario, Today, 12:50 AM
          0 responses
          3 views
          0 likes
          Last Post Rosario
          by Rosario
           
          Started by kemoyums, Today, 12:38 AM
          0 responses
          2 views
          0 likes
          Last Post kemoyums  
          Started by MartynBashi, Yesterday, 11:01 PM
          0 responses
          4 views
          0 likes
          Last Post MartynBashi  
          Working...
          X