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 NullPointStrategies, Yesterday, 05:17 AM
    0 responses
    55 views
    0 likes
    Last Post NullPointStrategies  
    Started by argusthome, 03-08-2026, 10:06 AM
    0 responses
    132 views
    0 likes
    Last Post argusthome  
    Started by NabilKhattabi, 03-06-2026, 11:18 AM
    0 responses
    73 views
    0 likes
    Last Post NabilKhattabi  
    Started by Deep42, 03-06-2026, 12:28 AM
    0 responses
    45 views
    0 likes
    Last Post Deep42
    by Deep42
     
    Started by TheRealMorford, 03-05-2026, 06:15 PM
    0 responses
    49 views
    0 likes
    Last Post TheRealMorford  
    Working...
    X