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 ScottWalsh, Today, 06:52 PM
      4 responses
      32 views
      0 likes
      Last Post ScottWalsh  
      Started by olisav57, Today, 07:39 PM
      0 responses
      4 views
      0 likes
      Last Post olisav57  
      Started by trilliantrader, Today, 03:01 PM
      2 responses
      19 views
      0 likes
      Last Post helpwanted  
      Started by cre8able, Today, 07:24 PM
      0 responses
      6 views
      0 likes
      Last Post cre8able  
      Started by Haiasi, Today, 06:53 PM
      1 response
      4 views
      0 likes
      Last Post NinjaTrader_Manfred  
      Working...
      X