Announcement

Collapse
No announcement yet.

question re back testing

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

  • question re back testing

    Hi,

    I have a question related to this thread.

    I was wondering when an indicator is calculated.
    What I mean is that if I were to put a 60 min interval MACD on a 1 min period chart and backtest it, when will the MACD be calculated?

    Is it every new bar, so in this case every 1 minute?
    or
    Is it every interval of the indicator, so in this case every 60 minutes?

    I know that in real time the calculations are done every trade.

    From comparison of my backtested results and the graphs the strategy is loaded on it seems to me that the 60 minute indictor is calculated every bar (in my case every 1 minute).

    Can anyone confirm this please?

    What I am worried about is false signals in real time which make my backtesting rubbish.

    Thanks

    Aengus

  • #2
    Re: Backtesting vs Realtime

    Aengus
    In real time an indicator is calculated on every tick [ie trade] unless otherwise set in the code.
    On historical bars an indicator is calculated once per bar depending on the interval on which it is based.
    That said if your concern is matching real time and back testing signals using multiple intervals you may want to read my reply in this thread
    Alex


    Originally posted by amclister
    Hi,

    I have a question related to this thread.

    I was wondering when an indicator is calculated.
    What I mean is that if I were to put a 60 min interval MACD on a 1 min period chart and backtest it, when will the MACD be calculated?

    Is it every new bar, so in this case every 1 minute?
    or
    Is it every interval of the indicator, so in this case every 60 minutes?

    I know that in real time the calculations are done every trade.

    From comparison of my backtested results and the graphs the strategy is loaded on it seems to me that the 60 minute indictor is calculated every bar (in my case every 1 minute).

    Can anyone confirm this please?

    What I am worried about is false signals in real time which make my backtesting rubbish.

    Thanks

    Aengus

    Comment


    • #3
      Alex,

      Thanks for the reply.

      Can you point me in the right direction to be able to change the compute source value from close to open of every bar on a MACD.

      I have tried this:

      macd(5,13,5,"Open",inv(15)).getValue(0)

      but its not working.

      I have also tried setting up a MACD study:

      var vMACD5_13 = new MACDStudy(5, 13, 5, "Open", false)

      and then referencing it like so:

      vMACD5_13,inv(60).getValue(MACDStudy.SIGNAL)

      but this isn’t working either.

      Any help would be greatly appreciated.

      Yours sincerely
      Aengus

      Comment


      • #4
        I have solved the problem with:

        macd(5,13,5).getValue(open(0, inv("60")))


        Thanks
        Aengus

        Comment


        • #5
          That hasnt worked - Im still stuck.

          Comment


          • #6
            Changing both the source and interval of a macd:

            Does anyone know how to change both the source and interval of a macd?

            Im going nuts with a trial and error approach and am getting nowhere.

            Im looking for something like this:

            Macd(5,21,13,inv(5),”open”)

            If anyone can point me in the right direction it would be greatly appreciated.

            Thanks
            Aengus

            Comment


            • #7
              Aengus
              See this thread for a complete set of examples on the syntax required by the efs2 functions
              Alex


              Originally posted by amclister
              Alex,

              Thanks for the reply.

              Can you point me in the right direction to be able to change the compute source value from close to open of every bar on a MACD.

              I have tried this:

              macd(5,13,5,"Open",inv(15)).getValue(0)

              but its not working.

              I have also tried setting up a MACD study:

              var vMACD5_13 = new MACDStudy(5, 13, 5, "Open", false)

              and then referencing it like so:

              vMACD5_13,inv(60).getValue(MACDStudy.SIGNAL)

              but this isn’t working either.

              Any help would be greatly appreciated.

              Yours sincerely
              Aengus

              Comment


              • #8
                Thanks Alex,

                Comment

                Working...
                X