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

Add Position Size on "X" Acct Equity Drawdown

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

    Add Position Size on "X" Acct Equity Drawdown

    I am looking for help with implementing an idea to change my strategy's position size once there is "X" account drawdown.
    I have attempted to use the documentation here

    Code:
    if (SystemPerformance.AllTrades.TradesPerformance.Currency.Drawdown >= 1000)
    {PositionFactor = 2;}
    if (SystemPerformance.AllTrades.TradesPerformance.Currency.Drawdown <= 0)
    {PositionFactor = 1;}
    The attached picture is to help communicate my intent. Combined with my code snippet intent, if the acct reaches $1000 down from equity high, I want to increase my position size (which I use PositionFactor to help do). Then when the account equity reaches new highs, turn the position size back to default until the $1000 drawdown is reached again.
    Any help would be appreciated. Thanks!

    #2
    Hello Mabba,

    Thanks for your post.

    Drawdown will be present as a negative number so your condition would need to be <= -1000.

    You can always use Print statement to print out the current value of drawdown: Print (Time[0]+" DrawDown: "+
    SystemPerformance.AllTrades.TradesPerformance.Curr ency.Drawdown);

    Paul H.NinjaTrader Customer Service

    Comment


      #3
      Thank you for your feedback Paul. I changed the polarity and used Print() but the number didn't make sense to me. I wasn't able to get drawdown to do what I wanted, but I ended up using CumProfit to generate the number that I was looking for. Thanks!

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by andrewtrades, Today, 04:57 PM
      1 response
      8 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Started by chbruno, Today, 04:10 PM
      0 responses
      5 views
      0 likes
      Last Post chbruno
      by chbruno
       
      Started by josh18955, 03-25-2023, 11:16 AM
      6 responses
      436 views
      0 likes
      Last Post Delerium  
      Started by FAQtrader, Today, 03:35 PM
      0 responses
      7 views
      0 likes
      Last Post FAQtrader  
      Started by rocketman7, Today, 09:41 AM
      5 responses
      19 views
      0 likes
      Last Post NinjaTrader_Jesse  
      Working...
      X