Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Limiting numbers of trades per week

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

    Limiting numbers of trades per week

    I have a swing trading strategy for ES and I am wondering if there is a way to :

    1. Stop placing new trades completely and stop executing any of strategies if I have total of two losing trades from market opening on sunday evening to close on friday afternoon. If I have two losing trades I want to quit trading for that week.

    2. Limit the number of both long and short orders to only 1 in a 24 hours time frame.

    3. Move my original stop loss by x points once the price moves by y points in a favorable direction.

    I greatly appreciate any help or guidance you can provide.
    Thanks.

    #2
    Hello pandyav,

    Thank you for your post.

    1) Yes this would be possible - please see our Reference Sample on Stopping a strategy after consecutive losers:



    2) Using the same concepts applied in the reference sample above, you can also accomplish this. Please review our Help Guide article on TradeCollection objects:

    http://www.ninjatrader.com/support/helpGuides/nt7/index.html?tradecollection.htm

    3) Please see our Reference Sample on Modifying the price of stop loss and profit target orders:

    MatthewNinjaTrader Product Management

    Comment


      #3
      I am struggling little bit with the first question as I want to stop trading if I have a total of two losses in a week. They may or may not consecutive. I wrote a simple code below which I can change every week.

      if ((ToDay(Time[0]) > 20111017) &&
      (ToDay(Time[0]) < 20111022) &&
      (Performance.AllTrades.LosingTrades.Count < 2))

      //do something if the above is true..

      I am wondering if the code will count losing trades for the entire week OR will reset itself to 0 at the start of every session everyday. I want to avoid the later scenario.

      Thanks.

      Comment


        #4
        It will keep counting the trades throughout the week unless you specify it to reset.

        If you look in the reference sample, you will see the following snippet:

        Code:
            // Reset the trade profitability counter every day and get the number of trades taken in total.
                    if (Bars.FirstBarOfSession && FirstTickOfBar)
                    {
                        lastThreeTrades = 0;
                        priorSessionTrades = Performance.AllTrades.Count;
                    }
        In our example, this resets the counter every day. Without something similar, it will keep the counter going until you reset it.
        MatthewNinjaTrader Product Management

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Aviram Y, Today, 05:29 AM
        0 responses
        2 views
        0 likes
        Last Post Aviram Y  
        Started by quantismo, 04-17-2024, 05:13 PM
        3 responses
        25 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by ScottWalsh, 04-16-2024, 04:29 PM
        7 responses
        34 views
        0 likes
        Last Post NinjaTrader_Gaby  
        Started by cls71, Today, 04:45 AM
        0 responses
        6 views
        0 likes
        Last Post cls71
        by cls71
         
        Started by mjairg, 07-20-2023, 11:57 PM
        3 responses
        217 views
        1 like
        Last Post PaulMohn  
        Working...
        X