Variation from candle high to low and low to high

Forums ProRealTime English forum ProOrder support Variation from candle high to low and low to high

Viewing 8 posts - 1 through 8 (of 8 total)
  • #61568

    Hi,

    I can’t find out how to use the ‘variation’ function to start counting from the candle high, and stop at the candle low and vise versa.

    I want to measure the price difference between a candle high and another candles low(or vise versa) over a period of time. I have been using the summation function as well to do this. Here’s the line of code that I’m using for context if needed;

     

    Thanks in advance

    #61569

    You have mixed 2 different ways to make your calculation. However, I don’t understand the code you made because of your RISE and FALL variables? Do you only want to know the price distance in percentage between 2 bars or counting how many times the price has ascended and declined?

    #61570

    The code that’s shown is just code I’ve put together myself using examples found in the PRT documentation. I would actually like for the code to return the distance between high and low but don’t know how to do that either. So just ignore the RISE and FALL, I only put the code in the post incase it wasn’t clear what I was talking about.

    #61579

    Ok, so the variation between two Closes could be programmed as follows:

    It measures the distance in percentage between the High of the previous bar to the Low of the 120th one before the current period.

    1 user thanked author for this post.
    #61591

    okay, so do I have to repeat that line for every possible amount of periods? Since 120 periods is a maximum amount of time, not a required amount

    #61592

    Yes, if you want to get other variations, just change the periods under brackets.

    1 user thanked author for this post.
    #61593

    I better start copy pasting then! But before I do, how can I get it so that a position is opened once half of the distance from high to low is reached? So then my system is complete and I don’t have re-do all 240 different cases in the near future.

    #61649

    I used the code you just gave me and I doesn’t seem to work. The code runs but doesn’t work as intended, any ideas why?

     

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

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