Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Plotting Limit and Stop

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

    Plotting Limit and Stop

    Good afternoon all,

    I have a Strategy that has a Stop and limit when i open a position.

    My question is... How do i plot them when i open that position.. I would like to have them visible and the have them stop until the next day... I only run one transaction per day.

    #2
    Hello Jorgesz,

    Thanks for your post and welcome to the forums!

    You could use the DrawLine method to draw a line for your stop and target (as well as entry price). This has been demonstrated with a reference sample code in the reference section here: http://www.ninjatrader.com/support/f...ad.php?t=18995

    In the reference sample, after an order has been placed 3 lines are drawn at the entry level, target level and stop level and these lines are extend on each onBarUpdate until the trade completes and then they are removed.

    Please let me know if I can be of further assistance.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Hello,

      I have a question in this concern please: When the exits are done from my script-strategy with ExitLong(1) referring to the conditions in the script then there is plotted the green dashed line from entry untill exit. But when I do the exit with a click on a button I made to scale out (and this works 100% OK!) then the dashed line is not plotted from entry untill the exit, there is no line plotted, but in the script I also have ExitLong(1), same as with the conditions. So, in the chart with one trade I have some green-dashed lines and some exits without dashed line. Why is the line not plotted in this case?

      Thank you
      Tony
      Last edited by tonynt; 03-23-2015, 01:57 PM. Reason: translation error

      Comment


        #4
        Hello tonynt,

        Thanks for your post.

        Can you advise if the script that places the orders and the script that exits the orders, including the button pushing script, are of the same strategy?
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Hello,

          thank you for your reply.

          Sure they are of the same strategy.

          Best
          Tony


          Originally posted by NinjaTrader_Paul View Post
          Hello tonynt,

          Thanks for your post.

          Can you advise if the script that places the orders and the script that exits the orders, including the button pushing script, are of the same strategy?

          Comment


            #6
            Hello Tony,

            Thanks for your confirmation that all of the code is contained within the same strategy. With that in mind I suspect that the code to trigger the exit when manually done via the external button unlinks the entry and exit and that is why the line is not drawn automatically even though the name remains the same. To validate this you can add traceorders to your code and observe if the external button orders are not linked. http://www.ninjatrader.com/support/h...raceorders.htm

            As an alternative to not having a system drawn line, you can use the drawline method discussed previously in this thread to create the visual connection and the drawline can be triggered by your use of the external button as is the exit.

            Please let me know if I can be of further assistance.
            Paul H.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by TraderG23, 12-08-2023, 07:56 AM
            9 responses
            382 views
            1 like
            Last Post Gavini
            by Gavini
             
            Started by oviejo, Today, 12:28 AM
            0 responses
            1 view
            0 likes
            Last Post oviejo
            by oviejo
             
            Started by pechtri, 06-22-2023, 02:31 AM
            10 responses
            125 views
            0 likes
            Last Post Leeroy_Jenkins  
            Started by judysamnt7, 03-13-2023, 09:11 AM
            4 responses
            59 views
            0 likes
            Last Post DynamicTest  
            Started by ScottWalsh, Yesterday, 06:52 PM
            4 responses
            36 views
            0 likes
            Last Post ScottWalsh  
            Working...
            X