Reply To: Technical Index Trading & Analysis

Home Forums Technical Index Trading & Analysis Technical Index Trading & Analysis Reply To: Technical Index Trading & Analysis

#3375
Kuntz
Participant

Ignore the last post

if you ensert this indicator into prorealtime you can
see it as a hide button that I cant get working.

//—— AV[Period, MAtype, LockChart, MinuteFrame] ——–//
// by PellePanter, Free Code, to use or to be changed
//———————————————————-//
// Date Ver Change
// 2015-04-20 1.0 MAtype 0-8 All code in RETURN
// 2015-04-25 1.1 Period changes with TimeFrame
// LockChart=True => “Hides” MA behind Close for all charts except TimeFrame Minute Chart
//———————————————————-//
// Funktion: AV[p,t, LockChart, MinuteFrame]
//
// Adjusts the MA to always show as Period p in MinuteFrame regardless of the charts TimeFrame.
// MinuteFrame, ex: 5 = 5M, 240 = 4H, 1440 = Daily, 10080 = Weekly
//
// In:
// p=Period: >0
// t=MAtype dropdown: 0-8 (replacing: Zerolag=DEMA, Hull=TEMA)
// LockChart=True: Only show the MA if the Charts TimeFrame is the same as MinuteFrame else MA=close
// MinuteFrame: >=0 (0=off, ex. MinuteFrame=60 with p=20 changes period to 80 in 15M chart and to 1200 in 1M)
//———————————————————-//

ONCE BarMinute=0
ONCE Per=undefined

If Barindex=1 THEN
BarMinute =ABS(Day-Day[1])*60*24+ ABS(Hour-Hour[1])*60+ABS(Minute-Minute[1])
Per=Round(p*MinuteFrame/BarMinute)+p*(MinuteFrame=0)
Per=Per*(Per>0)+(Per<1)
ENDIF

RETURN AVERAGE[Per*(t<7)+(t>=7),t*(t<7)](DEMA[Per*(t=7)+(t<>7)](TEMA[Per*(t=8)+(t<>8)]))*NOT ((LockChart AND MinuteFrame<>BarMinute) AND MinuteFrame=0)+Close*((LockChart AND MinuteFrame<>BarMinute) AND MinuteFrame=0)