PRC Alma MACD – get values from superior timeframe

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #62076 quote
    AbzAbz
    Participant
    Veteran

    Hello

    if we are using this indicator on 10 min chart  with standard value as in the code and if we want to use it on 1 min chart and obtain same values on the indicator as it was on 10 min chart is then enought to change only fastMA and SlowMA? like 12*10 and 26*10 ? i did try that but i dont get the same value on the indicator.

     

    //PRC_ALMA MACD | indicator
    //17.09.2016
    //parameters
    // Sigma = 4
    // Offset = 0.85
    // Fast = 12
    // Slow = 26
    // Signal = 9
    
    Price = customclose
    
    //---Fast MA
    m = (Offset * (Fast - 1))
    s = Fast/Sigma
    WtdSum = 0
    CumWt  = 0
    for k = 0 to Fast - 1 do
    Wtd = Exp(-((k-m)*(k-m))/(2*s*s))
    WtdSum = WtdSum + Wtd * Price[Fast - 1 - k]
    CumWt = CumWt + Wtd
    next
    FastMA = WtdSum / CumWt
    
    //---Slow MA
    n = (Offset * (Slow - 1))
    t = Slow/Sigma
    SWtdSum = 0
    SCumWt  = 0
    for k = 0 to Slow - 1 do
    SWtd = Exp(-((k-n)*(k-n))/(2*t*t))
    SWtdSum = SWtdSum + SWtd * Price[Slow - 1 - k]
    SCumWt = SCumWt + SWtd
    next
    SlowMA = SWtdSum / SCumWt
    
    //---MACD
    ALMAMACD = FastMA-SlowMA
    
    //---Signal MA
    n = (Offset * (Signal - 1))
    t = Signal/Sigma
    SWtdSum = 0
    SCumWt  = 0
    for k = 0 to Signal - 1 do
    SWtd = Exp(-((k-n)*(k-n))/(2*t*t))
    SWtdSum = SWtdSum + SWtd * ALMAMACD[Signal - 1 - k]
    SCumWt = SCumWt + SWtd
    next
    SignalMACD = SWtdSum / SCumWt
    
    RETURN ALMAMACD as "ALMA MACD", SignalMACD as "Signal line"
    
    #62110 quote
    NicolasNicolas
    Keymaster
    Legend

    That’s right, you can get reasonable accurate values, but not exactly the same, because the Close of a 10 minutes chart is not the same as the concatenation of 10 1minute bars. As long as ProBuilder not have multi timeframe support or variables arrays, it would be very hard to custom code something really relevant for that purpose.

    Abz thanked this post
Viewing 2 posts - 1 through 2 (of 2 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

PRC Alma MACD – get values from superior timeframe


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Abz @abbas_sadiq Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by NicolasNicolas
8 years, 7 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 02/08/2018
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...