• If this is your first visit, you will have to register before you can post. To view messages, please scroll below and select the forum that you would like to visits. Questions? Be sure to check out the Forum FAQ.

Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

multiple TPs, dynamic Quantity

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

    multiple TPs, dynamic Quantity

    Hi,

    im a beginner to NinjaTrader7 programming and im having a question:

    is it possible to have a position with a quantity of 4 contracts and lets say i have the same SL with 10 Ticks for all, but contract number 1 has a TP of 8 Ticks and the left 3 contracts have a TP of 16 ticks.

    Is it possible to do that in managed mode?

    What would be the basic algorithm?

    I tried to program this algorithm, but i have many problems with that and im pretty far from the result.

    Best regards.

    #2
    Hello maynn,

    Welcome to the forums!

    I see that you are referencing NinjaTrader 7 but have opened this post in the NinjaTrader 8 forum. I have created a demonstration for how you can set this up in the Strategy Wizard in NinjaTrader 7. The same can be done in the Strategy Builder in NinjaTrader 8.

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

    The Strategy Wizard and Strategy Builder create NinjaScript code following the managed Approach. Those order methods and their rules can be referenced below.

    NT7 Managed Approach -
    https://ninjatrader.com/support/help...d_approach.htm

    NT8 Managed Approach - https://ninjatrader.com/support/help...d_approach.htm

    I will also post links to the Strategy Wizard and Strategy Builder tutorials for further reference on how this tool can be used. I will suggest to use the Wizard or Builder to create a strategy, and then use the View Code button to observe the resulting code.

    Strategy Wizard 301 - https://www.youtube.com/watch?v=FmBiNYsf1e8

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

    Please let me know if I may be of further assistance.
    JimNinjaTrader Customer Service

    Comment


      #3
      Hello,

      thank you very much for your advice. I saw this possibility, but with this kind of solution, you would have multiple entries. But I only want to have one entry.

      Best regards

      Comment


        #4
        Hello maynn,

        Yes this would not be possible with the SetProfitTarget() or SetStopLoss() methods. I would then advise to create your own logic to place exit orders after you have entered.

        Order methods exist for placing Market Orders, Market-If-Touched Orders, Limit Orders, Stop Orders, and Stop Limit Orders. These methods exist in the managed approach to exit positions as well and they are available in the Strategy Builder and Strategy Wizard. You may use the links in my previous thread to reference these different order methods.

        I would advise to use these different order methods to manage your positions instead. I would also suggest to look into using Position.MarketPosition to control your logic to tell when you are in a flat, long or short position.

        Position.MarketPosition NT7 - https://ninjatrader.com/support/help...etposition.htm

        Position.MarketPosition NT8 - https://ninjatrader.com/support/help...etposition.htm

        If you have any additional questions, could you verify if you are using NinjaTrader 7 or NinjaTrader 8?
        JimNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by priceisking, Today, 12:51 PM
        1 response
        5 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by chartish, Today, 10:33 AM
        3 responses
        15 views
        0 likes
        Last Post chartish  
        Started by casabella, Today, 11:51 AM
        1 response
        6 views
        0 likes
        Last Post NinjaTrader_PaulH  
        Started by Johnny, Today, 11:42 AM
        1 response
        13 views
        0 likes
        Last Post NinjaTrader_Jermaine  
        Started by habibalex, Today, 09:03 AM
        2 responses
        13 views
        0 likes
        Last Post sledge
        by sledge
         
        Working...
        X