Hi
I'd like to ....
1. calculate 4 ema's (tf = timeframe)
o = ema(period1,open(inv(tf));
h = ema(period1,high(inv(tf));
l = ema(period1,low(inv(tf));
c = ema(period1,close(inv(tf));
2. then calculate smoothed heiken ashi values based on values returned from step 1.
ha_close = (o+h+l+c)/4;
ha_open = (ha_open(previous bar) + ha_close(previous bar))/2
ha_high = Math.max(h,ha_open);
ha_low = Math.min(l,ha_open);
3. Smooth again
calculate 4 new smoothed values using the results calculated in step 2. using the wma function.
ha2_close = wma(period2,ha_close values from step 2.)
ha2_open = wma(period2,ha_close values from step 2.)
ha2_high = wma(period2,ha_close values from step 2.)
ha2_low = wma(period2,ha_close values from step 2.)
then if close > open return trend=UP
if close < open return trend=DOWN
And I want to do this on 8 timeframes in the same study ... so i end up with 8 trend variables set to UP/DOWN for 8 different timeframes
Is this possible - I cannot get my head around how to do it!!!!
Thanks again your help is always much appreciated!
Paul
I'd like to ....
1. calculate 4 ema's (tf = timeframe)
o = ema(period1,open(inv(tf));
h = ema(period1,high(inv(tf));
l = ema(period1,low(inv(tf));
c = ema(period1,close(inv(tf));
2. then calculate smoothed heiken ashi values based on values returned from step 1.
ha_close = (o+h+l+c)/4;
ha_open = (ha_open(previous bar) + ha_close(previous bar))/2
ha_high = Math.max(h,ha_open);
ha_low = Math.min(l,ha_open);
3. Smooth again
calculate 4 new smoothed values using the results calculated in step 2. using the wma function.
ha2_close = wma(period2,ha_close values from step 2.)
ha2_open = wma(period2,ha_close values from step 2.)
ha2_high = wma(period2,ha_close values from step 2.)
ha2_low = wma(period2,ha_close values from step 2.)
then if close > open return trend=UP
if close < open return trend=DOWN
And I want to do this on 8 timeframes in the same study ... so i end up with 8 trend variables set to UP/DOWN for 8 different timeframes
Is this possible - I cannot get my head around how to do it!!!!
Thanks again your help is always much appreciated!
Paul
Comment