Back-testing of Demar TD Sequential

Forums ProRealTime English forum ProOrder support Back-testing of Demar TD Sequential

Viewing 15 posts - 1 through 15 (of 23 total)
  • #202089

    Dear all,

    As you may know in the pro-real library there is a Demark TD Sequential available: link: https://www.prorealcode.com/prorealtime-indicators/td-sequential-setup/

    Well, I have been trying to create a code to back test the Demark TD, but I am not able to create it, i thought (and I would very much appreciate) if any of you here could post the back-test code of a Demark TD simply. Would that be possible? Thank you so much in advance.

    #202109
    JS

    Hi @jonpt88

    You can do a simple conversion from an indicator to a trading system by removing the “draw elements” and adding buy and sell options

     

    1 user thanked author for this post.
    #202112

    You are always so helpful 🙂 Thank you again!

    #202113

    You are always so helpful 🙂 Thank you again! Looks very nice. And, how would that combine with heikin-ashi signals, I mean how would the back test code look like. Looking at the chart looks promising…Apologies,  I jus the post was published twice… Sorry for that.

     

    #202124
    JS

    Hi @jonpt88

    If you want to use the code with Heikin Ashi, you have to change the following:

    Close => HAClose = (Open + High + Low + Close) / 4
    Open => HAOpen = (Open[1] + Close[1]) / 2
    High => HAHigh = Max(High, Open, Close)
    Low => HALow = Low(Low, Open, Close)

    1 user thanked author for this post.
    #202128

    Hello JS,

     

    Thank you. I think I should have specified better:

    What I meant is that:

     

    Demark bullish signal + first (after demark bullish signal) heikin ashi green candle = buy

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = sell

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = short

    Demark bullish signal + first (after demark bullish signal) heikin ash green candle = close short.

     

    #202139

    Sorry for a second message in a row.

    Meanwhile I tried to combine them as I detailed above but I must be doing something wrong as no result appears… Let me clarify, a lot of times the Demark signal coincides with a bearish HA candle. However, what I want to do is back test of Demark as first condition + HA candle = such condition could take days (in daily chart to confirm) but it does not necessarily means that both conditions occur on the same date. If that make sense.

     

    #202212
    JS

    Hi @jonpt88

    Line 26 should be: xOpen = (xOpen[1] + xClose[1]) / 2

     

    1 user thanked author for this post.
    #202213

    Thank you for being always so helpful, JS.

    I was going nuts with the code. I have amended as you suggested but unfortunately I get no equity curve at all now… Is the amended you have suggested valid for the idea as follows:

    Demark bullish signal + first (after demark bullish signal) heikin ashi green candle = buy

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = sell

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = short

    Demark bullish signal + first (after demark bullish signal) heikin ash green candle = close short.

    #202234

    I get no equity curve at all now

    You don’t state an Instrument or a Timeframe (?), so attached is what I get (with code posted above, no changes)  on DJI over 10K bars, TF = 3 min, spread = 5

    1 user thanked author for this post.
    #202241

    Hi Grahal,

    Thank you for your participation and helpful reply. The equity curve does look promising, indeed.

    Unfortunately, I do not get results. I must be doing something wrong. Would you be so kind to post the entire code that you are using?

    That would be very much appreciated.

    Thank you in advance,

    #202242

    Also I have tried to edit the post and include further comments, but suddenly it was to late and hence I need to write a second post. Meanwhile, I manage to also get an equity curve. However, I am unsure if the strategy is following the following logic:

    Demark bullish signal + first (after demark bullish signal) heikin ashi green candle = buy

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = sell

    Demark bearish signal + first (after demark bearish signal) Heikin ashi red candle = short

    Demark bullish signal + first (after demark bullish signal) heikin ash green candle = close short.


    As said, first signal as a condition of the second signal and not necessarily simultaneously.

    #202246

    Enter exact like this, at bottom of strategy code …  GRAPH LongTriggered … then click on Backtest and you check if conditions for a Buy have occured correctly.

    Let us know how you get on.

    #202276

    Thanks, Grahal: To recap:

    Only small time frames work. No daily time frame.
    I think this why: the long / short etc are triggered only when e.g. green HA coincides with Demark bullish.

    Nevertheless, the idea is that: first Demark Bullish (as first condition), and then once the HA is green – to trigger the long position. Following this logic –> once the bearish demark (first condition), and once the red heikin ashi to trigger the close and short position, and so on. Instead, from what I see that is not what the code is doing. I read somewhere that to supedite one condition to the other one needs to create a “flag”(?), this exceeds by far my skills (which aare nill -I am total beginner – I am a pre-beginner… I am 0 at this. I did not even understand the flag idea on the training video :(.

    Thank you for your understanding and help, of course, only if you deem that I can receive it.

    #202277

    I’m not the best at coding, but I manage to do all I require for myself as I can check it out by backtesting and checking using GRAPH etc.

    Above can be time consuming and is best undertaken by the code Author or somebody convinced it is worth the time … i.e. going to make money at the end of all the analysis.

    from what I see that is not what the code is doing

    You can safely assume that the code will correctly execute as it is correctly written.

    GRAPH LongTriggered

    Did you do above?

    You can then set up the Indicators which are used in the code in order to check it all works as it should.

    Here you are, I’ve got you started as to how to do it … see attached!  The red arrowhead is pointing at a 1st green HAshi candle following red HAshi candles.

    You now set up as attached and also set up the first Demark Bullish (as first condition)?

     

Viewing 15 posts - 1 through 15 (of 23 total)

Create your free account now and post your request to benefit from the help of the community
Register or Login