Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Using drawdown as part of strategy

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

    Using drawdown as part of strategy

    Hello!

    Please, is there any way to control drawdown in strategy builder as a part of the condition?

    "IF CUM. MAX DRAWDOWN < XXX, then do something ..." (or something like that)

    If it is not possible to work with drawdown, could you please advise me some other way to determine and work with the "unsuccessful period"? For example, a sequence of unprofitable trades; increasing the average of successive loss-making trades; time to / before recover; decrease in percentage success etc.

    As a non-programmer, I can't open the code, so I'll be grateful for any advice.

    Thank you, have a nice day.

    #2
    Hello Bonifac,

    Thanks for your post.

    The strategy builder is limited in the trade information available to it. There are two selections you can use in the conditions builder in the strategy folder, RealizedPNL and UnrealizedPNL.

    For clarity:

    Strategy> RealizedPNL would be the accumulated Profit and loss of all the strategy trades, including historical, over the duration the strategy is applied (So if applied to 5 day chart, the RealizedPNL would reflect 5 days of historical trades). You can avoid all historical trades by adding the condition that checks to see if the Misc>current state is Misc>state State.Realtime as part of your entry conditions.

    Strategy>UnrealizedPNL is the current trade's Profit/Loss. If no current trade this would be zero, when in a trade it would be the value of the trade when checked (when is relative to the Calculate setting of the strategy).

    To accomplish your goals, you would not be able to use the strategy builder and would need to work directly in Ninjascript and accessing the following:






    If you would like your strategy created for you, we can provide references to 3rd party programmers.
    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your answer. Realized PNL is not very flexible over a longer period of time. But is there a possibility to use "inputs and variables" to reset Realized PNL? I mean every time "If RealizedPNL> 0, then return the value 0 to RealizetPNL".

      Thank you

      Comment


        #4
        Hello Bonifac,

        Thanks for your reply.

        There are no means to reset the strategy RealizedPNL which will keep accumulating.

        If you want to work on a per trade basis you could store the UnrealizedPNL in a variable when the current market position is not flat. and when you are flat the variable would hold the value of the last trade, (you would need to test this to confirm).

        If you wanted to work with Realized PNL, it would be possible using 2 custom series to create a dailyPNL value. Because math operations are not easily done in the strategy builder, you could store the strategyPNL in a custom series, store "Yesterdays PNL" in another custom series and then subtract the two to create a daily PNL value. To create yesterdays PNL, you would trigger using the Misc>first bar of the session to save the strategyPNL at that bar. You would also need to (on each bar) update the values in the series. YesterdaysPNL just needs to be equal to the previous bar value so that its value is carried forward for the duration of the session.
        Paul H.NinjaTrader Customer Service

        Comment


          #5
          Thank you. I was hoping there was a more convenient solution. Still, thank you for your advice.

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jclose, Today, 09:37 PM
          0 responses
          5 views
          0 likes
          Last Post jclose
          by jclose
           
          Started by WeyldFalcon, 08-07-2020, 06:13 AM
          10 responses
          1,414 views
          0 likes
          Last Post Traderontheroad  
          Started by firefoxforum12, Today, 08:53 PM
          0 responses
          11 views
          0 likes
          Last Post firefoxforum12  
          Started by stafe, Today, 08:34 PM
          0 responses
          11 views
          0 likes
          Last Post stafe
          by stafe
           
          Started by sastrades, 01-31-2024, 10:19 PM
          11 responses
          169 views
          0 likes
          Last Post NinjaTrader_Manfred  
          Working...
          X