Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

using different stop loss levels

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

    using different stop loss levels

    I want to use different stopLossNumber (below) depending on close1 =intrument[1]. priorClose.
    As I understand, setStop is defined on void Initialized(), therefore befora OnBarUptade (where I define close1).
    How can I handle to set something like below structure? (Is it possible to define close1 on Initialize()?)

    if close1>X
    set stopLossNumber =y
    else
    set stopLossNumber =z

    SetStopLoss("", CalculationMode.Percent, stopLossNumber, false);
    SetProfitTarget("", CalculationMode.Percent, stopGainNumber);

    I ve tried the strategy below but it did not work,, Any clue?
    Does Realtimestrades considers only the open position? or all positions of the day?
    How can I control an isolated position?
    if (Performance.RealtimeTrades.TradesPerformance.Perc ent.CumProfit < - stopLevelMovel)
    {
    ExitLong("stoptest");
    }
    Last edited by dafonseca; 04-20-2013, 08:12 AM.

    #2
    You won't be able to get the close in Initialize() but you can use Set methods within OnBarUpdate to dynamically update your targets/stops and are not required to set them in Initialize()

    We do suggest you set them in Initialize() if you want a static target/stop but it is not required.



    If you need more advanced order handling I'd suggest looking at http://www.ninjatrader.com/support/f...ead.php?t=7499

    Let me know if I can be of further assistance.
    LanceNinjaTrader Customer Service

    Comment


      #3
      What about this? Any clue..

      I ve tried the strategy below but it did not work,, Any clue?
      Does Realtimestrades considers only the open position? or all positions of the day?
      How can I control an isolated position?

      if (Performance.RealtimeTrades.TradesPerformance.Perc ent.CumProfit < - stopLevelMovel)
      {
      ExitLong("stoptest");
      }

      Comment


        #4
        To get unrealized PnL you would use this: http://www.ninjatrader.com/support/h...profitloss.htm

        RealtimeTrades would be used for trade management in terms of trades that have been closed. For example if you wanted to stop trading after having 3 live trades. http://www.ninjatrader.com/support/h...timetrades.htm

        Let me know if I can be of further assistance.
        LanceNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by Geovanny Suaza, 02-11-2026, 06:32 PM
        0 responses
        633 views
        0 likes
        Last Post Geovanny Suaza  
        Started by Geovanny Suaza, 02-11-2026, 05:51 PM
        0 responses
        364 views
        1 like
        Last Post Geovanny Suaza  
        Started by Mindset, 02-09-2026, 11:44 AM
        0 responses
        105 views
        0 likes
        Last Post Mindset
        by Mindset
         
        Started by Geovanny Suaza, 02-02-2026, 12:30 PM
        0 responses
        567 views
        1 like
        Last Post Geovanny Suaza  
        Started by RFrosty, 01-28-2026, 06:49 PM
        0 responses
        568 views
        1 like
        Last Post RFrosty
        by RFrosty
         
        Working...
        X