new york, ny/usa
Experience: Beginner
Platform: nt
Trading: futures
Posts: 128 since May 2012
Thanks Given: 32
Thanks Received: 50
|
I hop someone can help me. I would like to have an internal breadth indicator that does not reset each day but rather adds recent intraday period to to the previous day. Basically i want to do a cumulative sum of $addc or $voldc. For some reason I cannot get it work correct and it does not add correctly to the previous day...Here is my code. If anyone can help that would be great!
input exchange = {default NYSE, NASDAQ, AMEX};
def breadth;
switch (exchange) {
case NYSE:
breadth = close("$voldc");
case NASDAQ:
breadth = close("$UVOL/Q") - close("$DVOL/Q");
case AMEX:
breadth = close("$UVOA") - close("$DVOA");
}
def pcl = close("$voldc", AggregationPeriod.DAY);
def dailysum = TotalSum(pcl);
plot bread=dailysum[1]+breadth;
|