Announcement

Collapse
No announcement yet.

Partner 728x90

Collapse

Daily Indicator Values Intraday

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

    Daily Indicator Values Intraday

    I'm running a strategy on daily bars, but am trying to execute my trades intraday on 5 min bars.

    I have a bool variable that triggers when conditions are met on my daily bars and when that variable is true my trade is executed on the 5 min bars the following day (which is expected behavior).

    However, I would like to execute my trades on the same day the bool variable gets set to true. So basically I need to get the value of the indicator on my daily bar at a specific time intraday. How do I go about this?

    For clarification:
    As of now, my strategy checks if today's Momentum(13) value is lower than yesterday's Momentum(13). If it is, then my submitExit variable is true and the order will be executed tomorrow on the 5 min series.

    But I want to be able to look at the value of today's Daily Momentum(13) at some point before the market closes. If it looks like it will be lower than yesterday, I want to submit my order on the 5 min bars before the market closes today.

    COC is set to false.

    Is there a method to get this value or would I have to come up with a custom calculation? If I need to customize it, what is the best approach?

    #2
    Hello reticent67,
    In backtesting the calculations are made at the end of the bar. Thus the orders will be placed on the next day if your calculations are based on daily bars.

    The only alternative in such scenario is to test the strategy in Market Replay data with Calculate on bar close set to false.
    JoydeepNinjaTrader Customer Service

    Comment


      #3
      Originally posted by reticent67 View Post
      I'm running a strategy on daily bars, but am trying to execute my trades intraday on 5 min bars.

      I have a bool variable that triggers when conditions are met on my daily bars and when that variable is true my trade is executed on the 5 min bars the following day (which is expected behavior).

      However, I would like to execute my trades on the same day the bool variable gets set to true. So basically I need to get the value of the indicator on my daily bar at a specific time intraday. How do I go about this?

      For clarification:
      As of now, my strategy checks if today's Momentum(13) value is lower than yesterday's Momentum(13). If it is, then my submitExit variable is true and the order will be executed tomorrow on the 5 min series.

      But I want to be able to look at the value of today's Daily Momentum(13) at some point before the market closes. If it looks like it will be lower than yesterday, I want to submit my order on the 5 min bars before the market closes today.

      COC is set to false.

      Is there a method to get this value or would I have to come up with a custom calculation? If I need to customize it, what is the best approach?
      If you have COBC = false; as you say, then you should be seeing the current value of Momentum(13) on every tick throughout the day. What am I missing here?

      Comment


        #4
        Thanks for the quick response, as usual, Joydeep. I was afraid that might be the case.

        However, your answer brings up a two-fold question.
        1. I have not used Market Replay before so I will study up on that. But in the meantime, will market replay give me a tick by tick calculation of the indicator so I can just access it at a specific time with something like this:
        if (ToTime(Time[0]) >= 120000 && Momentum(BarsArray[0],13)[0] < Momentum(BarsArray[0], 13)[1])
        {
        ExitLong(...)
        }


        or is there another way of getting that value?


        2. I really need the indicator value intraday for backtesting. So could I create a dataseries with, say, 30 min bars, then every 30 mins add the Momentum value to a list and average out the list, then put the average into a dataseries? Would that be a viable solution? Is there a more elegant way of accomplishing this?


        @Koganam - I was under the same impression until I ran the SA. Unfortunately it indeed calculates the value at the end of the day. Any ideas how to get around it?

        Comment


          #5
          Originally posted by reticent67 View Post
          @Koganam - I was under the same impression until I ran the SA. Unfortunately it indeed calculates the value at the end of the day. Any ideas how to get around it?
          The SA does not run as a live situation. It's granularity can only allow execution at the end of a bar, as it cannot determine anything that happens intrabar because the only information available is the OHLC data.

          If you want finer granularity, you will have to add another barSeries and key off of that. Warning" a 1-tick bar series places a tremendous load on the system.

          Comment


            #6
            Understood - And I don't need that much granularity since it's a daily strategy. So I'm thinking that maybe adding 30 or 60 minute bars and checking the value of the indicator at the close of those bars. Then I can average them out to get the total daily value up to my required time period and finally comparing the average to yesterday's value.

            Do you think that would work?

            Comment


              #7
              Originally posted by reticent67 View Post
              Understood - And I don't need that much granularity since it's a daily strategy. So I'm thinking that maybe adding 30 or 60 minute bars and checking the value of the indicator at the close of those bars. Then I can average them out to get the total daily value up to my required time period and finally comparing the average to yesterday's value.

              Do you think that would work?
              That certainly sounds viable, but even simpler might be to use the typical price for the developing day, where you use Highest High, the Lowest Low, and the current Close to calculate it.

              Comment

              Latest Posts

              Collapse

              Topics Statistics Last Post
              Started by drewski1980, Today, 08:24 AM
              0 responses
              3 views
              0 likes
              Last Post drewski1980  
              Started by rdtdale, Yesterday, 01:02 PM
              2 responses
              16 views
              0 likes
              Last Post rdtdale
              by rdtdale
               
              Started by TradeSaber, Today, 07:18 AM
              0 responses
              7 views
              0 likes
              Last Post TradeSaber  
              Started by PaulMohn, Today, 05:00 AM
              0 responses
              10 views
              0 likes
              Last Post PaulMohn  
              Started by ZenCortexAuCost, Today, 04:24 AM
              0 responses
              6 views
              0 likes
              Last Post ZenCortexAuCost  
              Working...
              X