calculate % difference from candle high to candle low

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #60918 quote
    jbyrne
    Participant
    Average

    Hi, I’m working on prototyping a new indicator but I don’t know how to code it. I have tried multiple times but only attempt that got close wasn’t good enough.

    My indicator involves the following;

    Measuring the % distance between a candles high to low(low to high) within a 5 minute timeframe, with a 2 hour time limit. A position should then be opened if stock price reaches 50% of the previous % difference

    Bull Example;

    • (9:00am) stock price at high of 5 minute candle is 10
    • (9:30am) stock price at low of 5 minture candle is 9.9
    • % difference between 10 and 9.9 is -1%, which is past the minimum of 1%
    • % difference between 10 and 9.9 is -1%, therefore buy point is at 9.95 (+0.5%, since 10 – 0.5% = 9.95)
    •  (10:00am) stock price meets buy point at 9.95, long position is opened.

    Bear Example;

    • (9:00am) stock price at low of 5 minute candle is 10
    • (9:30am) stock price at high of 5 minture candle is 10.2
    • % difference between 10 and 10.1 is +1.9%, which is past the minimum of 1%
    • % difference between 10 and 10.1 is +1.9%, therefore buy point is at 10.1 (-0.5%) since: 10.2 – (1.9%/2) = 10.1)
    •  (10:00am) stock price meets buy point at 10.1, short position is opened since process took under 2 hours (start at 9:00am ends at 10:00am)

    Hope this is clear.

    Any help will be greatly appreciated. I have tried to code this myself many times using some knowledge I found on this forum but can’t get it to work properly. I used ‘summation’ repeated 14 times on 5 mintue timeframe which doesn’t seem like a good way of doing this. I wouldn’t be asking for help on this forum if I hadn’t already tried this myself already.

    Thanks in advance

Viewing 1 post (of 1 total)
  • You must be logged in to reply to this topic.

calculate % difference from candle high to candle low


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
jbyrne @jbyrne Participant
Summary

This topic contains 1 voice and has 0 replies.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/30/2018
Status: Active
Attachments: No files
Logo Logo
Loading...