Don't want to use DAX afterhours session to calculate indicators

Forums ProRealTime English forum ProOrder support Don't want to use DAX afterhours session to calculate indicators

  • This topic has 11 replies, 2 voices, and was last updated 5 years ago by avatarSeb.
Viewing 12 posts - 1 through 12 (of 12 total)
  • #75215
    Seb

    Hello, as some of you know IG has a trading session overnight for DAX outside of the regular futures session (08:00-22:00). The issue I have is that I want to plot the bars of this extra IG session, but I don’t want to use the OHLC data of those bars for my indicators for backtesting purposes. Does anybody know a solution for this?

    #75246

    For accurate calculation, it would be great to make personal arrays of data, and apply calculation of each of the indicators you are using on them, but it is not possible. However, there are 2 possibilities:

    1. use a time condition to allow or not your variables to be populated or not with the price data (the easy way, but not the more accurate one …)
    2. deconstruct all your indicators’ codes, make loops in the past, add time conditions to jump other not desired datas, and inject OHLC into indis calculation (the hard way but the better, but with limitations and a very painful work…).
    1 user thanked author for this post.
    avatar Seb
    #75267
    Seb

    Thank you Nicolas, do you have an example of possibility 2 for a simple indicator like Donchian?

    #75274

    ok, so to be clear, with the Donchian channel, let’s say of 20 periods, do you want to use the yesterday’s bars (before 220000 yesterday) for the calculation of the first 20 periods of the day (after 080000)?

    #75285
    Seb

    ok, so to be clear, with the Donchian channel, let’s say of 20 periods, do you want to use the yesterday’s bars (before 220000 yesterday) for the calculation of the first 20 periods of the day (after 080000)?

    exactly!

    #75304

    Ok, this should work, please let’s try it and give feedbacks:

     

    1 user thanked author for this post.
    avatar Seb
    #75310
    Seb

    I tried the code, I changed “profit” to “profits” as profit is a function.

    I graphed the “yh”, but this doesn’t update during the day as new highs are made (and your target or stop might be hit). you could use the normal highest[20](high) after the first 20 bars after 08:00. Until that you must count “x” up to 20 with the highest[x](high) to compare with “yh” if you want to be accurate.

    Thanks for this idea!

    #75332
    Seb

    What was the code that you used for the indicator you attached?

    #75339

    oh sorry, I posted the wrong code… it has nothing to deal with your indicator and I think I deleted it ; let’s do it again!! :angry:

    #75340

    I need to rest a bit! Too hot near a computer 🙂

     

    #75364
    Seb

    that is some smart code, merci Nicolas!

    #75481
    Seb

    Trying to get my head around the code to make an ATR version now, but like you said, very painful work!

Viewing 12 posts - 1 through 12 (of 12 total)

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