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

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:	565
Size:	14.6 KB
ID:	1130407Click image for larger version

Name:	Screenshot_3.jpg
Views:	531
Size:	15.6 KB
ID:	1130408
    sidlercom80
    NinjaTrader Ecosystem Vendor - Sidi Trading

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

    This is an expansion of the the NinjaTrader Lines Drawing Tool(s) that adds text boxes to each line that will show prices associated with the endpoint or where the line crosses the price scale. Vertical lines will show time stamps. Your own messages can be added to each text box. New settings can be set […]


    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.



    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:



    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).
      sidlercom80
      NinjaTrader Ecosystem Vendor - Sidi Trading

      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 ;-)
          sidlercom80
          NinjaTrader Ecosystem Vendor - Sidi Trading

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by quantismo, 04-17-2024, 05:13 PM
          5 responses
          32 views
          0 likes
          Last Post NinjaTrader_Gaby  
          Started by proptrade13, Today, 11:06 AM
          1 response
          5 views
          0 likes
          Last Post NinjaTrader_Clayton  
          Started by love2code2trade, 04-17-2024, 01:45 PM
          4 responses
          34 views
          0 likes
          Last Post love2code2trade  
          Started by cls71, Today, 04:45 AM
          2 responses
          10 views
          0 likes
          Last Post eDanny
          by eDanny
           
          Started by kulwinder73, Today, 10:31 AM
          1 response
          10 views
          0 likes
          Last Post NinjaTrader_Erick  
          Working...
          X