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

Adding a second contract with trailing stop

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

    Adding a second contract with trailing stop

    I'm new to NT8 and trying to learn to build strategies. I have a basic strategy built that is working with 1 contract, and a simple profit target and stop in place.

    I would like to know where I can find information on how, if my strategy is set to trade 2 contracts per execution, the stop moves to break even after the first profit target is filled, and then trails the second contract by (x) number of ticks until either second profit target is hit, or the stop is triggered.

    Any direction is appreciated.

    Bullywig

    #2
    Hello Bullywig,

    Would this be created using the Builder or manually coded?

    In the case of manually coding, likely the best starting place would be the following examples. Using the OnExecutionUpdate override would allow you to track when specific orders fill to complete logic like a breakeven.

    The OnOrderUpdate() and OnExecution() methods are reserved for experienced programmers. Instead of using Set() methods to submit stop-loss and profit target orders, you can submit and update them manually through the use of IOrder and IExecution objects in the OnOrderUpdate() and OnExecution() methods. The OnOrderUpdate()



    If this is the Builder this would require further review to see what would be required for this type of logic.

    I look forward to being of further assistance.
    JesseNinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by PaulMohn, Today, 12:36 PM
    0 responses
    2 views
    0 likes
    Last Post PaulMohn  
    Started by love2code2trade, 04-17-2024, 01:45 PM
    4 responses
    38 views
    0 likes
    Last Post love2code2trade  
    Started by alifarahani, Today, 09:40 AM
    2 responses
    14 views
    0 likes
    Last Post alifarahani  
    Started by junkone, Today, 11:37 AM
    3 responses
    21 views
    0 likes
    Last Post NinjaTrader_ChelseaB  
    Started by frankthearm, Yesterday, 09:08 AM
    12 responses
    44 views
    0 likes
    Last Post NinjaTrader_Clayton  
    Working...
    X