• 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

  • NinjaTrader_Jim
    replied
    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?

    Leave a comment:


  • maynn
    replied
    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

    Leave a comment:


  • NinjaTrader_Jim
    replied
    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.

    Leave a comment:


  • maynn
    started a topic multiple TPs, dynamic Quantity

    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.

Latest Posts

Collapse

Topics Statistics Last Post
Started by Eric M., Today, 05:25 PM
0 responses
2 views
0 likes
Last Post Eric M.
by Eric M.
 
Started by ttodua, Today, 01:52 PM
1 response
17 views
0 likes
Last Post NinjaTrader_Jim  
Started by muisca, 05-19-2017, 11:49 AM
8 responses
6,466 views
0 likes
Last Post NinjaTrader_Tyler  
Started by NinjaTrader_Brandon, Today, 12:08 PM
0 responses
78 views
0 likes
Last Post NinjaTrader_Brandon  
Started by iq200, Today, 12:00 PM
2 responses
11 views
0 likes
Last Post iq200
by iq200
 
Working...
X