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

Multiple Targets and Trail StartBehavior

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

    Multiple Targets and Trail StartBehavior

    Hello,

    I need help with my strategy... The issue is that the strategy does not wait until flat before submitting a new order, although StartBehavior is set to WaitUntilFlat.

    It is entering with three contracts… I created three Limit Orders, all submit on the same set of conditions, but each order has its own unique quantity & signal name… I added ProfitTargets to 2 of the Orders, and the last has no ProfitTarget, it only has a TrailingStop… I tried UniqueEntries and AllEntries; as well as setting Entries per direction to 1 and then I tried 3... Still, the strategy would submit new orders although the trailing contract is still working.

    I was wondering, is it possible to have one LimitOrder with Quantity 3 contracts, and then change the quantity for the ProfitTargets? My aim is for the strategy to have a variable for ProfitTarget Quantity and for it not to submit new orders while one contract is still trailing.

    #2
    Hello KINGKODA,

    Thanks for your post and welcome to the NinjaTrader forums!

    The start behavior addresses the strategy transition from historical to live. When your strategy is applied it will begin performing trades on the historical data. If, on the last historical bar there is a historical trade in progress then on the first live bar the status would show yellow indicating that the strategy is waiting to complete the historical trade before initiating a live trade.

    From your description, I think you are trying to use the start behavior to prevent orders from being placed until you are flat in the normal course of the strategy run. What you would want to use as part of the entry conditions is a check of the market position. For example:

    if (Position.MarketPosition == MarketPosition.Flat && (your other entry conditions))
    {
    // enter the 3 orders here
    }
    Reference: https://ninjatrader.com/support/help...etposition.htm

    You would need to keep the individual orders so you can tie the trail stop to 1 and stoploss to the others by the signal names.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by cre8able, Today, 01:16 PM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by chbruno, 04-24-2024, 04:10 PM
    3 responses
    47 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by samish18, Today, 01:01 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_LuisH  
    Started by WHICKED, Today, 12:56 PM
    1 response
    8 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Started by WHICKED, Today, 12:45 PM
    1 response
    11 views
    0 likes
    Last Post NinjaTrader_Gaby  
    Working...
    X