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 plot average entry within a strategy

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

    How to plot average entry within a strategy

    My exits on some positions are based on the average entry. How do I plot average entry in a strategy so I can more easily evaluate visually if it is taking the exits correctly?
    Thx!

    #2
    Hello ShruggedAtlas,
    Thanks for your post.

    Do you just want to plot some text on the chart letting you know what your average entry is?
    Josh G.NinjaTrader Customer Service

    Comment


      #3
      No i was hoping to plot a line. I'm taking mulitple positions in a trade and to reduce risk I want to close the largest position when it is at profit and reaches my avg entry. having a line plotted on the chart helps me see it when I'm evaluating the strategy

      Ok i think i might have figured it out:

      Draw.HorizontalLine(this,@"Accumulation1 Horizontal Line",false,Position.AveragePrice,Brushes.Green,Da shStyleHelper.Solid,2);

      Seems to work - I hope this is helpful for anyone trying to accomplish this.
      Last edited by ShruggedAtlas; 05-18-2018, 09:53 AM.

      Comment


        #4
        Glad you got it figured out, but that is an NT8 method. I was under the assumption that you were working in NT7. For anyone that wants the NT7 way:

        Code:
        protected override void OnPositionUpdate(IPosition position)
        {
        	DrawHorizontalLine("tag", Position.AvgPrice, Color.Green);
        }
        Josh G.NinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by RideMe, 04-07-2024, 04:54 PM
        5 responses
        28 views
        0 likes
        Last Post NinjaTrader_BrandonH  
        Started by f.saeidi, Today, 08:13 AM
        1 response
        4 views
        0 likes
        Last Post NinjaTrader_ChelseaB  
        Started by DavidHP, Today, 07:56 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_Erick  
        Started by kujista, Today, 06:23 AM
        3 responses
        9 views
        0 likes
        Last Post kujista
        by kujista
         
        Started by Mindset, Yesterday, 02:04 AM
        2 responses
        18 views
        0 likes
        Last Post NinjaTrader_RyanS  
        Working...
        X