Parabolic SAR Code

Viewing 2 posts - 16 through 17 (of 17 total)
  • Author
    Posts
  • #174049 quote
    rochnickols
    Participant
    New
    // Indicateur SAR de Wilder V.11
    // Chroniques de Bourse
    // Merci à Jean M. pour la mise à jour du programme
    
    once facteur=0.02
    once increment=0.02
    once maxfacteur=0.2
    extreme1=extreme[1]
    tendance1=tendance[1]
    tmpsar1=tmpSAR[1]
    high1=high[1]
    low1=low[1]
    
    if tendance1 = 1 then
    extreme = max(extreme1, high)
    if tmpsar1 > low then
    tendance = -1
    facteur = 0.02
    tmpSAR = extreme
    extreme = low
    else
    if extreme > extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment)
    endif
    tmpSAR =tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = min(tmpSAR,min(low,low1))
    endif
    elsif tendance1 = -1 then
    extreme = min(extreme1, low )
    if tmpsar1 <high then
    tendance = 1
    facteur = 0.02
    tmpSAR = extreme
    extreme = high
    else
    if extreme < extreme1 and facteur <maxfacteur then
    facteur = min( maxfacteur, facteur + increment )
    endif
    tmpSAR = tmpsar1+facteur*(extreme-tmpsar1)
    tmpSAR = max(tmpSAR,max(high,high1))
    endif
    else
    facteur = 0.02
    tmpSAR = low
    extreme = high
    tendance = 1
    endif
    // couleur du SAR
    if tmpSAR>=tmpSAR[1] then
    col=1
    else
    col=-1
    endif
     
    return tmpSAR[1] coloured by col as "SAR"
    #174061 quote
    robertogozzi
    Moderator
    Legend

    Try replacing [1] with [0]  (or nothing)  in the last line:

    return tmpSAR[0] coloured by col as "SAR"  //or return tmpSAR coloured by col as "SAR"
Viewing 2 posts - 16 through 17 (of 17 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Parabolic SAR Code


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
tom123 @tom123 Participant
Summary

This topic contains 16 replies,
has 2 voices, and was last updated by robertogozzi
5 years, 1 month ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 01/13/2018
Status: Active
Attachments: 3 files
Logo Logo
Loading...