Gap greater than 0.7%

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #138404 quote
    Oliviertrader2020
    Participant
    Average

    Hello, I would like to create a condition when a gap of more than 0.7% (between the previous day’s closing and the opening of the day) appears on the market.
    My goal is to make it a condition to program a strategy that will only take trades with Proorder on directional days with large gaps, and extreme openings with volume.
    I was able to code a gap indicator but as soon as I try to put a % variation it doesn’t work.
    Can someone help me?

    C1 = variation (dopen(0) > dclose(1))* 0.5
    #138410 quote
    Oliviertrader2020
    Participant
    Average
    C1 = variation (dopen(0) > dclose(1))* 0.7
    #138411 quote
    robertogozzi
    Moderator
    Master

    VARIATION cannot be used because it makes the difference between the same price on different candles. Also you used a logical value instead of a price.

    Try this:

    x   = dopen(0) - dclose(1)
    y   = x * 100 / dclose(1)
    C1 = (y >=  0.7)
    Oliviertrader2020 thanked this post
    #138413 quote
    GraHal
    Participant
    Master

    Roberto beat me to it and I’ve no doubt did it correctly! 🙂

    Mods

    this post can be deleted please

    ­robertogozzi: let’s keep it

    Oliviertrader2020 thanked this post
    #138418 quote
    Oliviertrader2020
    Participant
    Average

    Thank you so much @robertogozzi and @GraHal !

    GraHal thanked this post
Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.

Gap greater than 0.7%


ProOrder: Automated Strategies & Backtesting

New Reply
Summary

This topic contains 4 replies,
has 3 voices, and was last updated by Oliviertrader2020
5 years, 7 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 07/04/2020
Status: Active
Attachments: No files
Logo Logo
Loading...