• 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

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

    Leave a comment:


  • 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, 01:05 AM. Reason: SetStopLoss, SetProfitTarget

Latest Posts

Collapse

Topics Statistics Last Post
Started by ren37, Today, 02:39 AM
0 responses
3 views
0 likes
Last Post ren37
by ren37
 
Started by ralett, Yesterday, 03:39 PM
1 response
13 views
0 likes
Last Post NinjaTrader_Marco  
Started by Aporshnev, Today, 01:47 AM
1 response
6 views
0 likes
Last Post NinjaTrader_Marco  
Started by caveat_lector, Today, 12:12 AM
1 response
6 views
0 likes
Last Post Atm Card  
Started by ksarin, Yesterday, 04:31 PM
2 responses
9 views
0 likes
Last Post Atm Card  
Working...
X