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 cre8able, Yesterday, 01:16 PM
        3 responses
        11 views
        0 likes
        Last Post cre8able  
        Started by ChartTourist, Today, 08:22 AM
        0 responses
        6 views
        0 likes
        Last Post ChartTourist  
        Started by LiamTwine, Today, 08:10 AM
        0 responses
        2 views
        0 likes
        Last Post LiamTwine  
        Started by Balage0922, Today, 07:38 AM
        0 responses
        5 views
        0 likes
        Last Post Balage0922  
        Started by JoMoon2024, Today, 06:56 AM
        0 responses
        6 views
        0 likes
        Last Post JoMoon2024  
        Working...
        X