Creation of an Oscilator

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

    I saw this code on tradingview that I am trying to ode in prorealcode without luck. Please help

    //@version=4
    study(“Chart Traders: PivotBoss – Oscillator”, overlay=false)

    shortPEMA = input(8)
    medPEMA = input(13)
    longPEMA = input(21)
    smaPeriods = input(1)

    fPivot = hlc3
    fPEMADiff1 = (ema(fPivot, shortPEMA) – ema(fPivot, longPEMA))
    fPEMADiff2 = (ema(fPivot, medPEMA) – ema(fPivot, longPEMA))
    fPEMADiff3 = (ema(fPivot, shortPEMA) – ema(fPivot, medPEMA))

    fPEMASep = ((fPEMADiff1 + fPEMADiff2 + fPEMADiff3) / fPivot) * 5
    fPSepSMA = sma(fPEMASep, smaPeriods)

    col = if fPEMASep > 0 and fPEMASep > fPEMASep[1]
    color.gray
    else
    if (fPEMASep < fPEMASep[1]) or (fPEMASep < 0 and fPEMASep < fPEMASep[1])
    color.red
    else
    if fPEMASep > fPEMASep[1]
    color.gray
    else
    color.new(color.black, 100)

    plot(fPEMASep, title=”PEMASep”, color=col, linewidth=3, style=plot.style_columns)

    plot(fPSepSMA, title=”PSepSMA”, color=color.gray, linewidth=2)
    plot(0, title=”ZERO”)

    PEMA.jpg PEMA.jpg
    #172040 quote
    oyinloyea
    Participant
    Veteran

    Based on the above, this is the original code for the EMA of pivots on Price. Now I want to create an oscillator based the elements used in the code shown below.

    // Daily Pivot
    Timeframe(Daily,UpdateOnClose)
    MyPivot = (high + low + close) /3 //Daily Pivot
    //MyEma = Average[ave,1](MyPivot) //Ema8 of Daily Pivot
    Pema13 = Average[13,1](MyPivot)
    Pema34 = Average[34,1](MyPivot)
    Pema55 = Average[55,1](MyPivot)
    Timeframe(default)

     

    Oscilator wil be smilr to the attaced below
    RETURN Pema13 AS “Pema13”, Pema34 as “Pema34” , Pema55 as “Pema55”

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

Creation of an Oscilator


ProScreener: Market Scanners & Detection

New Reply
Author
author-avatar
oyinloyea @oyinloyea Participant
Summary

This topic contains 1 reply,
has 1 voice, and was last updated by oyinloyea
4 years, 9 months ago.

Topic Details
Forum: ProScreener: Market Scanners & Detection
Language: English
Started: 06/19/2021
Status: Active
Attachments: 2 files
Logo Logo
Loading...