Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Getting the First Hour High.

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

    Getting the First Hour High.

    Hello, I am new to NT. I have programmed before so I am not really new to programming. What I need to do is to get the first hour's high and then trade when that high is breached.
    Sounds simple - yet I cannot seem to be able to do this using the strategy wizard.
    Also I don't think coding something like :
    if ToTime(Time[0]) >= 10300
    set FirstHourHigh = CurrentDayOHL().CurrentHigh
    Then
    If Close[0] > FirstHourHigh
    buy

    I don't think this will work since it will constantly repopulate the FirstHourHigh every time a new high is reached.
    If I change it to If ToTime = 10300 then my computer has to be on at that time to make sure I get a correct value for the first hour high, which is not always possible.
    I need to be able to turn my computer at any time and be able to run the strategy which will get the first hour high and generate a trade when that high is breached.

    This also means that there will be no trades before 10:30 as the high is unknown yet.

    Am I missing something? Is there a way to do this?
    Any help would be greatly appreciated.

    Thanks

    #2
    Welcome

    Please see the following page. Reference sample #4 might provide you some assistance in this area.

    http://www.ninjatrader-support.com/v...ead.php?t=3220
    RayNinjaTrader Customer Service

    Comment


      #3
      if (Bars.BarsSinceSession < 30 && High[0] > highestHigh)
      highestHigh = High[0]

      In the above how many minute bars are these? 5 Min Bars, 30Min Bars? Is there a way to set it to a specific bar (ie. 5 minute bar)

      Thanks

      Comment


        #4
        It will be whatever chart the strategy is applied to.
        RayNinjaTrader Customer Service

        Comment


          #5
          Do you mean if I apply it to a chart with 5 min bars then it will be 5 min and if I apply it to 30 min bars it will be 30min.

          But what I want to do is backtest this across say the DOW 30 stocks without having the chart for any of them open.
          How would the system know in this case how big or small of a bar to work with?

          Comment


            #6
            The reference sample refers to 30 bars which could be of an interval depending on what your backtest was set to. If you run a basket backtest using 1 min bars, then the reference sample would mark the high of 30 bars etc...
            RayNinjaTrader Customer Service

            Comment

            Latest Posts

            Collapse

            Topics Statistics Last Post
            Started by WNorton, Today, 11:23 AM
            0 responses
            8 views
            0 likes
            Last Post WNorton
            by WNorton
             
            Started by stafe, Today, 10:43 AM
            0 responses
            8 views
            0 likes
            Last Post stafe
            by stafe
             
            Started by UltraNIX, Today, 09:13 AM
            1 response
            10 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by Tuxstuff215, Today, 06:32 AM
            1 response
            15 views
            0 likes
            Last Post NinjaTrader_ChrisL  
            Started by carlot, Today, 08:10 AM
            2 responses
            21 views
            0 likes
            Last Post carlot
            by carlot
             
            Working...
            X