Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Moving Stop Loss and Enter Reverse

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

    Moving Stop Loss and Enter Reverse

    I am trying to get a strategy to work that involves the following:

    ParabolicSAR on a 14 minute time frame. (BarsArray[0])

    Another PSAR on a Daily time frame. (BarsArray[1])

    On the 15M time frame, on each bar update I move my stop loss and an enter a reverse equal to the daily PSAR as follows:

    if (Position.MarketPosition == MarketPosition.Long)
    {
    SetStopLoss(CalculationMode.Price, ParabolicSAR(BarsArray[1],0.02,0.02,0.2)[0]);
    EnterShortStop(DefaultQuantity, ParabolicSAR(BarsArray[1],0.02,0.02,0.2)[0]);
    }

    The problem I encounter is when the PSAR switches between long/short and the PSAR value ends up opposite than my logic intends - resulting in a the placement of a stoploss and then shortstop above my current price. (or visversa for shorts).

    Can you suggest how I can move the stoploss and short/longstop based on the daily PSAR while running in 15M?

    #2
    I suspect you are running into some internal order handling violations when attempting to submit a stop loss and enter short stop. You can't have both. Please check out the Help Guide NinjaScript section that discusses Orders. In the overview section the rules are clearly defined. Your issues probably start there. I would post a link for you but we do not have 6.5 DOC online yet.
    RayNinjaTrader Customer Service

    Comment


      #3
      Ray,

      Thanks. I have read the Orders page but... well, let's just say it's a good thing I have a day job! Anyway, I will study it some more and see if I can learn something this time. I did "solve" the problem by removing the EnterLong/ShortStop()'s, but it also caused about a 15% drop in pips.

      Thanks again.

      Comment

      Latest Posts

      Collapse

      Topics Statistics Last Post
      Started by CarlTrading, 03-31-2026, 09:41 PM
      1 response
      62 views
      0 likes
      Last Post NinjaTrader_ChelseaB  
      Started by CarlTrading, 04-01-2026, 02:41 AM
      0 responses
      33 views
      0 likes
      Last Post CarlTrading  
      Started by CaptainJack, 03-31-2026, 11:44 PM
      0 responses
      44 views
      1 like
      Last Post CaptainJack  
      Started by CarlTrading, 03-30-2026, 11:51 AM
      0 responses
      58 views
      0 likes
      Last Post CarlTrading  
      Started by CarlTrading, 03-30-2026, 11:48 AM
      0 responses
      47 views
      0 likes
      Last Post CarlTrading  
      Working...
      X