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 pmachiraju, 11-01-2023, 04:46 AM
      8 responses
      148 views
      0 likes
      Last Post rehmans
      by rehmans
       
      Started by mattbsea, Today, 05:44 PM
      0 responses
      5 views
      0 likes
      Last Post mattbsea  
      Started by RideMe, 04-07-2024, 04:54 PM
      6 responses
      33 views
      0 likes
      Last Post RideMe
      by RideMe
       
      Started by tkaboris, Today, 05:13 PM
      0 responses
      5 views
      0 likes
      Last Post tkaboris  
      Started by GussJ, 03-04-2020, 03:11 PM
      16 responses
      3,283 views
      0 likes
      Last Post Leafcutter  
      Working...
      X