• 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

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 Vincere, Today, 04:38 AM
    0 responses
    2 views
    0 likes
    Last Post Vincere
    by Vincere
     
    Started by trader_rick, Today, 04:02 AM
    1 response
    3 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Started by percma, Today, 02:51 AM
    0 responses
    5 views
    0 likes
    Last Post percma
    by percma
     
    Started by Abilene, Today, 01:27 AM
    0 responses
    14 views
    0 likes
    Last Post Abilene
    by Abilene
     
    Started by simjs, Yesterday, 08:11 PM
    1 response
    5 views
    0 likes
    Last Post NinjaTrader_ChrisSch  
    Working...
    X