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

# of operations per session

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

    # of operations per session

    Hello,

    Anyone knows how to put a limit of trades per operations in automated strategies? (for example 2-3 trades per session), and if it is possible in strategy builder.

    Thank You

    #2
    Hello felipetfk,

    Thanks for opening the thread.

    This can be accomplished in the Strategy Builder by using separate entry conditions for a first, second and third entry, and then to set bools that tell us if we have entered once, twice or three times. These bools will control each entry condition. Another condition can then be used to reset these bools on the First Bar of a new Session.

    I have attached a video demonstration explaining how the logic can be set up.

    Demo - https://www.screencast.com/t/wkrBkiEmSSW

    The Strategy Builder 301 tutorial also provides a complete walkthrough for using the Strategy Builder. If you have not yet seen this tutorial, I highly recommend viewing it.

    Strategy Builder 301 - https://www.youtube.com/watch?v=HCyt90GAs9k

    Please let us know if you have any questions.
    JimNinjaTrader Customer Service

    Comment


      #3
      Awesome! thank you very much.

      I'm trying to stablish a condition related to the one that you sent, but specifying that if the first
      trade reaches the profit target, stop trading for the session, and then if the first trade reaches the stop loss, do a second trade and then stop the operations for the session.

      Maybe you or someone know the conditions associated with those variables or i have to create another?

      Thank you.

      Comment


        #4
        Hello felipetfk,

        You could use BarsSinceExitExecution (Misc > Bars since exit) to detect when an exit has occurred, and also use additional bools to control the logic from submitting additional trades.

        SetProfitTarget and SetStopLoss will create exit signal names of "Profit target" and "Stop loss"

        If you would like to differentiate these signal names in your strategy, you could use your own exit methods in your logic to place your own protective orders for target and stop with custom exit signal names.

        To get familiar with BarsSinceExitExecution, I recommend creating a simple strategy that has a basic entry and exit, and then to print the output of BarsSinceExitExecution in the output window. This way you can see how the method works and how it can be implemented in your strategy.

        I have attached another demonstration showing how you can add prints to take debugging steps in the Strategy Builder. Debugging steps are a regular part of development where we can better understand how the code is executing and how it can be written.

        Debugging in the Strategy Builder - https://www.screencast.com/t/8uvjfM8h

        If you are interested in having this logic written for you, we can have a representative of our EcoSystem write back with more information on NinjaScript Consultants who would be happy to create this strategy or any other at your request.

        Please let us know if this is the case.
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Barry Milan, Today, 10:35 PM
        1 response
        7 views
        0 likes
        Last Post NinjaTrader_Manfred  
        Started by WeyldFalcon, 12-10-2020, 06:48 PM
        14 responses
        1,428 views
        0 likes
        Last Post Handclap0241  
        Started by DJ888, Yesterday, 06:09 PM
        2 responses
        9 views
        0 likes
        Last Post DJ888
        by DJ888
         
        Started by jeronymite, 04-12-2024, 04:26 PM
        3 responses
        40 views
        0 likes
        Last Post jeronymite  
        Started by bill2023, Today, 08:51 AM
        2 responses
        16 views
        0 likes
        Last Post bill2023  
        Working...
        X