Announcement

Collapse

Looking for a User App or Add-On built by the NinjaTrader community?

Visit NinjaTrader EcoSystem and our free User App Share!

Have a question for the NinjaScript developer community? Open a new thread in our NinjaScript File Sharing Discussion Forum!
See more
See less

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.
    JimNinjaTrader Customer Service

    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.
        JimNinjaTrader Customer Service

        Comment


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

          Regards

          Comment

          Latest Posts

          Collapse

          Topics Statistics Last Post
          Started by jjs12, Today, 10:29 AM
          2 responses
          8 views
          0 likes
          Last Post jjs12
          by jjs12
           
          Started by Ludwik, Today, 03:52 AM
          7 responses
          32 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Started by wuannetraam, Today, 02:40 AM
          3 responses
          25 views
          0 likes
          Last Post NinjaTrader_ChelseaB  
          Started by sdauteuil, 09-23-2021, 10:16 AM
          5 responses
          1,221 views
          0 likes
          Last Post NinjaTrader_RyanS  
          Started by lakman184, 03-24-2024, 01:30 PM
          5 responses
          29 views
          0 likes
          Last Post NinjaTrader_Jesse  
          Working...
          X