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

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
    BertrandNinjaTrader Customer Service

    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.
          BertrandNinjaTrader Customer Service

          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 PhillT, 04-19-2024, 02:16 PM
                  4 responses
                  33 views
                  0 likes
                  Last Post PhillT
                  by PhillT
                   
                  Started by ageeholdings, 05-01-2024, 05:22 AM
                  5 responses
                  36 views
                  0 likes
                  Last Post ageeholdings  
                  Started by reynoldsn, Today, 02:34 PM
                  0 responses
                  11 views
                  0 likes
                  Last Post reynoldsn  
                  Started by nightstalker, Today, 02:05 PM
                  0 responses
                  18 views
                  0 likes
                  Last Post nightstalker  
                  Started by llanqui, Yesterday, 09:59 AM
                  8 responses
                  30 views
                  0 likes
                  Last Post llanqui
                  by llanqui
                   
                  Working...
                  X