Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Analyzer query- order quantity

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

    Strategy Analyzer query- order quantity

    Hi

    Is there a way with the strategy analyser to backtest a strategy, and set a % of my capital I'd like to risk on every trade, so the backtest results show the $ amount I would make or lose?

    e.g. To input that I have a starting capital amount of $100,000, and I'd like to risk 1% ($1,000) on every trade, across the portfolio that I'm backtesting.

    If my capital went down after a loss to, say, $99,000 I'd like the analyser to still trade 1% of my pot, but this time, it would only be committing $990 on the next trade. If this lost, I'd like the analyser to trade $980. So on, and so forth...

    I'm new to NT and seem to be struggling to program this part in, although it is probably really simple!

    Many thanks
    Steve

    #2
    Hello Steve,

    I put together a sample to demonstrate this.

    The strategy enters trades and uses a 7 tick Stop Loss, with order quantity being dynamic.

    You should set the bool isBacktest to true if you'd like to input your starting account size, and test the strategy historically, otherwise if its set to false the strategy will only run in real time and your account size will be pulled from NT Sim 101 account.

    The strategy will adjust the trade size based on account size value.

    Please let us know if you need further assistance.
    Attached Files
    Alan P.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    81 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    149 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    79 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    52 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    59 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X