Mactheriverrat 3,156 posts msg #123803 - Ignore Mactheriverrat |
5/18/2015 4:24:38 AM
Looking for code that I can add in as a column using say a moving average is up day 1 from the day before
|
four 5,087 posts msg #123811 - Ignore four modified |
5/18/2015 5:35:28 PM
Looking for code that I can add in as a column using say a moving average is up day 1 from the day before
set{up, count(ma(3) > ma(3) 1 day ago,1)}
add column up > 0
draw ma(3)
|
Mactheriverrat 3,156 posts msg #123816 - Ignore Mactheriverrat |
5/19/2015 5:16:01 AM
Thanks Four!
|
four 5,087 posts msg #123818 - Ignore four |
5/19/2015 1:04:36 PM
:)
|
Mactheriverrat 3,156 posts msg #123820 - Ignore Mactheriverrat |
5/19/2015 1:43:35 PM
I went back to some code for tracking how many up days or down days a stock has been up or down. I used the EMA(4) as a example as a price may close red but the EMA(4) will still be in a uptrend.
here is the code
CxC is number of consecutive days ema(4) above (+)/below(-) previous ema(4) and set{CCb,days(ema(4) is above ema(4) 1 day ago,100)}
set{CCa,days(ema(4) is below ema(4) 1 day ago,100)} set{CxC, CCa - CCb} and add column CxC {C_x_C}
do not draw CxC
|