Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Short sale restriction SPY

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

    Short sale restriction SPY

    Hello, I backtest a strategy with SPY one minute for 5 years, but i wish the strategy dont work when short rule restriction apply on the SPY, Some indicator help me with this?

    My backtest have margin of error if these days the strategy work in the backtest.

    Regards

    #2
    Hello walter739,

    Thanks for your post.

    Could you elaborate on your goal? If you are trying to prevent the strategy from taking short trades within certain conditions, you can create conditions that meet your criteria to restrict trading, and if those conditions are true, you can set a bool which would control your strategy actions to false.

    You can then protect your short trading logic with a check if that bool is true. When your conditions set the bool to false, the logic controlling your short trades will not become true, and those actions will not be taken.

    We look forward to assisting.

    Comment


      #3
      Hello Jim, thank you for answer, yes i am trying to prevent the strategy from taking short trades when the spy is short restriction apply, but i dont know how apply this in my strategy. Do you have me advices for these.

      I read the short restriction apply when the stock down 10 percent for the close previous day, but with the Spy i see the restriction was less percent for Interactive brokers.

      Sorry i am no expert, maybe it is happen low times and not is representative in a strategy, But in these months before happens many times.

      Regards

      Comment


        #4
        Hello walter739,

        Thanks for clarifying.

        OnMarketData can provide LastClose. If you have a look at the Net Change Market Analyzer Column, you can see how LastClose can be compared with incoming ticks to calculate the Net Change. You can then check if the Net Change is less than -10% to signal if the strategy should flip a bool to prevent the logic from taking short trades.

        OnMarketData - https://ninjatrader.com/support/help...marketdata.htm

        If this is from a separate strategy that runs on another instrument, you can add an SPY data series to the script so it can read SPY data as well as the primary data series of the strategy.

        Multi Time Frame and Instruments - https://ninjatrader.com/support/help...nstruments.htm

        We look forward to assisting.

        Comment


          #5
          Thank you for your time, i am work on that.

          Regards

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by Geovanny Suaza, 02-11-2026, 06:32 PM
          0 responses
          647 views
          0 likes
          Last Post Geovanny Suaza  
          Started by Geovanny Suaza, 02-11-2026, 05:51 PM
          0 responses
          368 views
          1 like
          Last Post Geovanny Suaza  
          Started by Mindset, 02-09-2026, 11:44 AM
          0 responses
          108 views
          0 likes
          Last Post Mindset
          by Mindset
           
          Started by Geovanny Suaza, 02-02-2026, 12:30 PM
          0 responses
          571 views
          1 like
          Last Post Geovanny Suaza  
          Started by RFrosty, 01-28-2026, 06:49 PM
          0 responses
          573 views
          1 like
          Last Post RFrosty
          by RFrosty
           
          Working...
          X