Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

How to configure the SetProfitTarget and SetStopLoss on a specific entry

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

    How to configure the SetProfitTarget and SetStopLoss on a specific entry

    Hi,

    In my script, I integrate 3 different trades that are executed in different contexts.

    The 1st one :

    EnterLong();
    ExitLong();

    does not have any profit/loss exit

    The 2nd one :

    EnterShort( Convert.ToInt32( MW_QTY_in_use ), "MW" );
    SetStopLoss("MW", CalculationMode.Ticks, MW_SL_in_use/TickSize, false );
    SetProfitTarget("MW", CalculationMode.Ticks, MW_TP_in_use/TickSize );
    ExitShort( Convert.ToInt32( MW_QTY_in_use ), "", "" );

    The 3rd one :

    EnterLong(Convert.ToInt32( DefaultQuantity ),"ON");
    SetStopLoss("ON", CalculationMode.Ticks, ON_StopLoss/TickSize, false );
    SetProfitTarget("ON", CalculationMode.Ticks, ON_TakeProfit/TickSize );
    ExitLong( Convert.ToInt32( DefaultQuantity ),"ON", "" );

    The 1st one may overlap with the 2nd and/or 3rd and the profit/loss exits are applied to it.

    How can I configure the exits on a specific entry without any interference?

    Kind Regards,
    Last edited by Vincere; 03-26-2019, 02:05 AM. Reason: SetStopLoss, SetProfitTarget

    #2
    Hello Vincere,

    Thanks for your post.

    When you are in a long position and place a short entry it will close the long entry with a market order called "close position" and then place another order to enter in the direction you intend. The same would be true when short and you place a long entry. You can only control the exits (Profit target/stoploss), by signal name, when the entries are in the same direction.

    To accomplish your goals you would need to separate your strategy so that you do not have long closing short and vice-versa AND would need to use a separate account for each strategy so that you can maintain account position while placing trades on the same instrument.
    Paul H.NinjaTrader Customer Service

    Comment

    Latest Posts

    Collapse

    Topics Statistics Last Post
    Started by tornadoatc, Today, 01:23 PM
    0 responses
    5 views
    0 likes
    Last Post tornadoatc  
    Started by Akee5, Today, 12:46 PM
    1 response
    6 views
    0 likes
    Last Post NinjaTrader_ShawnB  
    Started by XM010-3841, Today, 12:57 PM
    0 responses
    3 views
    0 likes
    Last Post XM010-3841  
    Started by sdauteuil, Today, 12:44 PM
    0 responses
    5 views
    0 likes
    Last Post sdauteuil  
    Started by franco12364, Today, 12:07 PM
    1 response
    4 views
    0 likes
    Last Post sdauteuil  
    Working...
    X