Recall swing points conditions

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #97805 quote
    maximus78
    Participant
    Senior

    Hello to everybody, I have a question.

    According to the following conditions of swing points and the chart attached:

    SPH=high[2]<high[1] and high[0]<=high[1] // (swing point high)
    SPL= low[2]>low[1] and low[0]>=low[1] // (swing point low)

    how can i recall for example SPH1 or SPL2 to set proscreener or probuilder indicator conditions?

    For example, I want to screen for the conditions: SPH1 >SPH2 and SPL1<SPL2 …….etc…

    Thanks in advance for your help

    Max

    Swing-points.jpg Swing-points.jpg
    #97807 quote
    robertogozzi
    Moderator
    Master

    To write code, please use the <> “insert PRT code” button, to make code easier to read.

    Thank you.

    You have to use a different variable for any swing point you want to recall.

    Since PRT does  not support arrays you cannot access those data dynamically.

    #97808 quote
    Vonasi
    Moderator
    Master
    if high[2]<high[1] and high[0]<=high[1] then
    sph3 = sph2 
    sph2 = sph1
    sph1 = high[1]
    endif
    
    if low[2]>low[1] and low[0]>=low[1]
    spl3 = spl2
    spl2 = spl1
    spl1 = low[1]
    endif
    
    

    Maybe the above is something like what you want and what Roberto means by needing a different variable for each swing point? You will need to check that sph1, sph2, sph3, spl1,spl2 and spl3 etc have a different value than zero before you use them in a condition.

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

Recall swing points conditions


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
maximus78 @maximus78 Participant
Summary

This topic contains 2 replies,
has 3 voices, and was last updated by Vonasi
6 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 05/06/2019
Status: Active
Attachments: 1 files
Logo Logo
Loading...