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

GAP Up and Down

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

    GAP Up and Down

    Hi

    I'm working on strategy where if the market gaps up then buy close of first 5min candle on 24 hour chart.

    I have 24\7 chart template on but I determine gaps based on pit sessions (9AM-3PM EST)

    Gap Open to me is defined as opening print at 9AM EST-yesterday pit session high>.50

    how do i program this in strategy wizard?

    THanks
    Chak

    #2
    Hello Chak,

    To create this in the wizard requires making time comparisons and storing values in user variables. To get started on this, see the following link:


    See the sections for:
    How to create time comparisons
    How to offset an item value

    See this link for a sample on working with user variables.
    • Define the times you want to store these values for.
    • Set user defined variable to a price bar value.
    • Use these user defined variables in trade condition. You can work with offset fields to add / subtract values.
    Last edited by NinjaTrader_RyanM1; 08-17-2011, 02:25 PM.
    Ryan M.NinjaTrader Customer Service

    Comment


      #3
      Thanks Rayan....

      I have already reviewed them...

      here is my understanding...please help me if its incorrect

      • Define the times you want to store these values for.
        Store which values? price?

      i'm decided with times, its 9AM and 3PM
      • Set user defined variable to a price bar value.

      Lets say todays date= Aug 16 201
      if current time=9AM then send the 5 min bar open price to Variable X=91.10
      if current time=3PM then send the close price to Variable Y=92.20

      next day Aug 17 2011 say price gapped up by $1
      now new 9 clock open price value is assigned to X if current time=9AM then send the open price to Variable X which becomes 93.20 (previous close+$1=>93.20)

      now how do i make sure I'm comparing today's X value with yesterday's Y value? which stratey wizard button should i use?


      Again, thanks for your help

      Comment


        #4
        Yeah, you got the right idea. For the most control, especially with date time objects, you will have to work in code.

        It all depends when you access these values for current / prior session. The values you capture will always be the most recent ones matching the time stamp. You can use these user variables in an entry condition after 9:00 AM, but before 3:00 PM. Then the 9:00 AM captured value is for the current session, and the 3:00 PM value is for the prior session.
        Ryan M.NinjaTrader Customer Service

        Comment


          #5
          thank Rayan...

          If i want to calculate GAP up using yesterdays high (instead of close) what function should i use?

          I understood how it can be done using yesterday close as i know exactly what time close occurs(3PM) but high price is variable and could occur any time of the pit session. any ideas?

          Thanks
          Chak.

          Comment


            #6
            There is a built in indicator you can use for this -- PriorDayOhlc(). It's available under the indicator category.
            Ryan M.NinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by ZeroKuhl, Today, 04:31 PM
            0 responses
            14 views
            0 likes
            Last Post ZeroKuhl  
            Started by Vulgoth_t_Destroyer, 05-09-2022, 04:45 PM
            54 responses
            5,337 views
            0 likes
            Last Post Gaterz
            by Gaterz
             
            Started by ETFVoyageur, 05-07-2024, 07:05 PM
            11 responses
            76 views
            0 likes
            Last Post -=Edge=-  
            Started by _Zero_, 04-10-2020, 03:21 PM
            145 responses
            7,901 views
            6 likes
            Last Post johng2
            by johng2
             
            Started by TheTradingMantis, 01-19-2023, 02:05 AM
            43 responses
            923 views
            0 likes
            Last Post jmagaia
            by jmagaia
             
            Working...
            X