Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Strategy Builder Trade Counter

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

    Strategy Builder Trade Counter

    Hi there, I have searched the forum for samples of trade counters using custom series. I have been trying for some weeks now and my counter is 1/2 working, which is to say it is not working at all .

    I am using unirenko bars to enter long/short on a trend. And it works great, but it keeps taking trades because conditions are true again on the same trend once a trade closes, which makes it enter on the next bar.

    I am trying to limit the trades on a single trendline to a specific number I would set in an input variable, for example, 2 or 3. Once no.of trades <= 3, stop trading until trend line reverses. This STOP and Reverse logic already works perfectly, but I won’t to stop trading after 3 trades.

    I have used a custom series of type INT where I set the value to 0 on first bar of session, and increment (offset +1) on EnterLong, but I also check the condition if No. Of Trade <= maxTrades variable. I can print values above bar and I can see it incrementing, but I can see that it prints incremented values repeated instead of stopping.

    I am looking for a sample with strategy builder similar to some of the other samples like PNL, etc. to borrow logic inspiration and add to my strategy. I can also post screenshots of the setup and logic, but there is quite a number of conditions along side the trade counter that may be confusing (reverse check, time check, tick delays, etc).

    Thank you so much for your time and help.

    #2
    Hello mgalal,

    Below is a link to an example of using series to do counting using math in the offset.
    with regard to the attached image: Line A is an indicator Line B is the m period MAX of line A Line C is an average of this indicator A Line D is another average of this indicator A is it possible, possibly using the strategy builder, but without adding a temporary variable, to set on the condition: line C crosses below line D


    As well as an example of using series to track PnL.
    Hello, I've updated the DailyLossLimit and DailyLosLimitMultiTrade examples that were posted on the forum for NinjaTrader 7 for NinjaTrader 8. These are often requested and I felt they are good examples to have for NT8. DailyLossLimitExample_NT7 - http://ninjatrader.com/support/forum...241#post451241 (http://ninjatrader
    Chelsea B.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by Mindset, 04-21-2026, 06:46 AM
    0 responses
    88 views
    0 likes
    Last Post Mindset
    by Mindset
     
    Started by M4ndoo, 04-20-2026, 05:21 PM
    0 responses
    134 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by M4ndoo, 04-19-2026, 05:54 PM
    0 responses
    68 views
    0 likes
    Last Post M4ndoo
    by M4ndoo
     
    Started by cmoran13, 04-16-2026, 01:02 PM
    0 responses
    119 views
    0 likes
    Last Post cmoran13  
    Started by PaulMohn, 04-10-2026, 11:11 AM
    0 responses
    67 views
    0 likes
    Last Post PaulMohn  
    Working...
    X