Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Programming ETD

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

    Programming ETD

    Hello - ETD is a good calculation to view on trade results, Im curious if that data is kept on a trade by trade basis and can the stat be used in programming an exit on a strategy.

    Example if on close ETD exceeds 4% exit position

    Please advise, thank you

    #2
    Yes, you could access the strategy statistics in the Performance class for example - http://www.ninjatrader-support.com/H...luesClass.html

    Comment


      #3
      Perfect thank you

      Comment


        #4
        In working with your link, it appears ETD is only an average value calculated on all trades. Is there any way to use ETD on a trade by trade basis?

        Thank you

        Comment


          #5
          Correct, it would give you access to the statistics of the complete strategy performance. You could apply custom code to record the change in the ETD on a trade by trade basis.

          Comment


            #6
            Understood - but can you work with ETD on a backtested basis bar by bar (or tick by tick) or would you have to measure ETD once the trade is closed?

            Comment


              #7
              The trade performance class only provides information related to completed trades.

              You should be able to manually calculate any values for the trade in progress. You can track:
              MAX(High, BarsSinceEntry())[0] compared to exit price, for example.
              Last edited by NinjaTrader_RyanM1; 12-02-2010, 10:53 AM.
              Ryan M.NinjaTrader Customer Service

              Comment


                #8
                Thanks Ryan - I attempted to use the sample code you provided

                MAX(High, BarsSinceEntry())

                but Ninja doesnt seem to like the arrangment of the arguments. (exact error code reads The best overloaded method match for 'NinjaTrader.Strategy.Strategy.MAX(NinjaTrader.Dat a.IDataSeries.int)'has some invalid arguments)

                Any additional samples or educational material on C# you could point me to on building this logic would be helpful. Thank you

                Comment


                  #9
                  Thanks for the follow up, titleistbb22.

                  Here is an accurate example:
                  double highSinceEntry = MAX(High, BarsSinceEntry())[0];

                  Using the condition builder is a good way to get syntax for these functions. You're not able to specify this exact condition but is useful for getting the order of parentheses and brackets.
                  Ryan M.NinjaTrader Customer Service

                  Comment

                  Latest Posts

                  Collapse

                  Topics Statistics Last Post
                  Started by Geovanny Suaza, 02-11-2026, 06:32 PM
                  0 responses
                  627 views
                  0 likes
                  Last Post Geovanny Suaza  
                  Started by Geovanny Suaza, 02-11-2026, 05:51 PM
                  0 responses
                  359 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by Mindset, 02-09-2026, 11:44 AM
                  0 responses
                  105 views
                  0 likes
                  Last Post Mindset
                  by Mindset
                   
                  Started by Geovanny Suaza, 02-02-2026, 12:30 PM
                  0 responses
                  562 views
                  1 like
                  Last Post Geovanny Suaza  
                  Started by RFrosty, 01-28-2026, 06:49 PM
                  0 responses
                  567 views
                  1 like
                  Last Post RFrosty
                  by RFrosty
                   
                  Working...
                  X