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

Premarket condition in Strategy Builder

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

    Premarket condition in Strategy Builder

    If I have a chart including premarket data. Is there a condition in Strategy Builder that can refer to an event that occurred during premarket hours or in an earlier specific time?
    Say I want to enter when price crosses above moving average (during regular market hours) and price was above moving average during premarket time today. Any advise welcomed.
    Thank you.

    #2
    Hello designer01,

    There is not a specific property which would let you know its premarket vs normal hours. To the strategy it just sees that there is data to process during that time. The easiest way to do what you are asking would be to make a time condition with the pre market hours as the time range, you could add that to any set where you wanted it to only work during pre market hours.

    JesseNinjaTrader Customer Service

    Comment


      #3
      Hi Jesse,
      Thank you. Would something like this work. I guess I have to add it to the code script manually unless there is a way in Strategy Builder.

      Code:
      if Time > 929 and Time <= 930
      {
      PreMarketCriteria = true;
      }

      Comment


        #4
        Hello designer01,

        Yes that would be the concept. To do that in the builder you would need to add two conditions to the set, the first checking that the Time Series is greater than Time Value of 929 and then the same for the second condition checking that the time series is less than or equal to time value of 930.

        JesseNinjaTrader Customer Service

        Comment

        Latest Posts

        Collapse

        Topics Statistics Last Post
        Started by tsantospinto, 04-12-2024, 07:04 PM
        7 responses
        126 views
        0 likes
        Last Post aligator  
        Started by futtrader, 04-21-2024, 01:50 AM
        5 responses
        56 views
        0 likes
        Last Post NinjaTrader_Eduardo  
        Started by PeakTry, Today, 10:49 AM
        0 responses
        2 views
        0 likes
        Last Post PeakTry
        by PeakTry
         
        Started by llanqui, Today, 10:32 AM
        0 responses
        5 views
        0 likes
        Last Post llanqui
        by llanqui
         
        Started by StockTrader88, 03-06-2021, 08:58 AM
        45 responses
        3,994 views
        3 likes
        Last Post johntraderuser2  
        Working...
        X