Hi all,
I have a script that scans for 3 consecutive weekly rising price and volume with the % set at 2% currently.
On increasing price and volume, it seems to work fine although I have my suspicions that it's not displaying every available tickers that fulfilled it.
On the contrary for decreasing price and increasing volume, it picked up a couple of results that did not fulfill the code and this script seems like it's using week 4(assuming this week is week 1 on a Sunday instead of using week 3)
The code I have is as below, would appreciate any kind assistance/input, thanks in advance!
I have a script that scans for 3 consecutive weekly rising price and volume with the % set at 2% currently.
On increasing price and volume, it seems to work fine although I have my suspicions that it's not displaying every available tickers that fulfilled it.
On the contrary for decreasing price and increasing volume, it picked up a couple of results that did not fulfill the code and this script seems like it's using week 4(assuming this week is week 1 on a Sunday instead of using week 3)
The code I have is as below, would appreciate any kind assistance/input, thanks in advance!
Code:
input price = close;
input length = 3;
input vol = volume;
def twoPercentGainPrice = 100 * (price / price[1] - 1) >= 2.0;
def threeBarsOfGainPrice = twoPercentGainPrice[2] and twoPercentGainPrice[1] and twoPercentGainPrice;
def twoPercentGainVol = 100 * (vol / vol[1] - 1) >= 2.0;
def threeBarsOfGainVol = twoPercentGainVol[2] and twoPercentGainVol[1] and twoPercentGainVol;
plot scan = threeBarsOfGainPrice[1] and threeBarsofGainVol[1];