MTF and issue with SAR formula

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #171756 quote
    pavixpavix
    Participant
    Average

    Hello everyone

    I am using the SAR formula as here below.
    My main timeframe is 15minutes, But I am trying to use this SAR indicator in the 1H timeframe.

    I have therefore created an basic indicator to view the in the 15m window the values of that 1h SAR
    I am using the GRAPHONPRICE function to check the values used for my strategy

    However, if i am facing several issue:
    – in the 15m timeframe window
    – the extreme SAR of the 1H timeframe(Lowest or highest in a trend) is delayed by 1 or 2 periods
    – this is the only issue with the indicator – the delay
    – but with the stratagy, there is the delay with the extreme point, but then every steps / variation is different from the 1h window

    I have of course expanded my 15min chart to 10k, then 50k then 200k units, but no changes;

    Please note than I am facing the same Delay issue with the basic SAR (1 period delay)
    Please not as well I have teste those configurations with the updateonclose function or not
    ANy idea ?
    Thank you in advance

    DEFPARAM CALCULATEONLASTBARS = 50000
    
    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
    If tendance[1]= 1 then
    Col=1
    Else
    col=-1
    Endif
     
    return tmpSAR[1]
    #171780 quote
    NicolasNicolas
    Keymaster
    Legend

    Je ne suis pas certain de bien comprendre, mais pourquoi ne pas utiliser directement l’instruction SAR avec le MTF dans un indicateur:

    timeframe(1 hour,updateonclose)
    isar = SAR[0.02,0.02,0.2]
    
    return isar
    
    #171816 quote
    pavixpavix
    Participant
    Average

    Thank you Nicolas

    I agree : with the SAR function, this is working.
    However, there is a slight difference in terms of value between the SRA function and the SAR formula mentioned here above ; moreoverthe value is totally different when the SAR is touched by the price.

    Point is that I Still do not understand why in this case this formula gievs different results as an indicator or a called function under a strategy.
    I am still investigating – I am moving forward in the meanwhile with the basic SAR function

Viewing 3 posts - 1 through 3 (of 3 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

MTF and issue with SAR formula


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
pavix @pavix Participant
Summary

This topic contains 2 replies,
has 2 voices, and was last updated by pavixpavix
5 years, 3 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 06/14/2021
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...