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

'Trade Counter' Variable?

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

    'Trade Counter' Variable?

    I'm wondering if there is an automated way to limit the number of trades a strategy will make once it hits a certain limit. For example I have a strategy that works well if it trades <10 times, but there are days where it does poorly and much of that is due to overtrading. Is there a way that I can have the strategy turn off after 10 trades? I tried to use the strategy builder to implement a line of code to the effect of "if TradeCount < User Variable", but I can't find a variable as part of the indicators that will serve as a trade counter.

    Thanks in advance.

    #2
    Hello FutTrader9000,

    You could use similar logic to this sample which increments a variable. You would need to increment the series when you submit the entry and then part of your entry condition check that the value is less than the target number of entries.

    Is there a way to increment an int in the strategy builder? When I go to set an int equal to itself there's no way to add 1 to it as well. Just wondering if this is possible in the wizard.


    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by burtoninlondon, Today, 12:38 AM
    0 responses
    10 views
    0 likes
    Last Post burtoninlondon  
    Started by AaronKoRn, Yesterday, 09:49 PM
    0 responses
    14 views
    0 likes
    Last Post AaronKoRn  
    Started by carnitron, Yesterday, 08:42 PM
    0 responses
    11 views
    0 likes
    Last Post carnitron  
    Started by strategist007, Yesterday, 07:51 PM
    0 responses
    14 views
    0 likes
    Last Post strategist007  
    Started by StockTrader88, 03-06-2021, 08:58 AM
    44 responses
    3,983 views
    3 likes
    Last Post jhudas88  
    Working...
    X