Hi Community
I'm wondering if the below code is the most efficient manner in which to approach this script (from a syntax perspective).
The idea here is as close passes through the stack of ema's and the distance between ema's 15 and 30 as price action ascends >-0.02 percent with the reverse being true if price action descends <0.02 percent.
I hope the information provided is helpful and welcome all the correction and help I can get.
shared chart link: http://tos.mx/!JCaU8i71 MUST follow these instructions for loading shared links.
I'm wondering if the below code is the most efficient manner in which to approach this script (from a syntax perspective).
Code:
def price = close;
def ema3 = expAverage(close,3);
def ema15 = expAverage(close,15);
def ema30 = expAverage(close,30);
def ema60 = expAverage(close,60);
def emadistmembrane1pct = (ema15 / ema30) - 1;
def ascension = ema30 crosses above ema60;
def descension = ema30 crosses below ema60;
Plot ema5Up = if close crosses above ema3 and ema3<ema15 and ema15<ema30 and ema60>ema30 and emadistmembrane1pct>-0.02 then 1 else close crosses above ema60 and ema30>ema15 and ema15 crosses above ema60[8]and ascension[8];
Plot ema5Dn = if close crosses below ema3 and ema3>ema15 and ema15>ema30 and ema30>ema60 and emadistmembrane1pct<0.02 then 1 else close crosses below ema60 and ema15>ema30 and ema15 crosses below ema60[8] and descension[8];
The idea here is as close passes through the stack of ema's and the distance between ema's 15 and 30 as price action ascends >-0.02 percent with the reverse being true if price action descends <0.02 percent.
I hope the information provided is helpful and welcome all the correction and help I can get.
shared chart link: http://tos.mx/!JCaU8i71 MUST follow these instructions for loading shared links.
Last edited by a moderator: