shakib3585
Active member
Greetings all,
I am trying to create a code for visualizing spread during regular and pre/post hours. I have generated the code as given. During regular hours, I rarely see the label turn green, even though the stock price is going up. Sometimes the label turns black. Also, during pre/post hours , is there a way to see the spread? Please help.
Thanks
I am trying to create a code for visualizing spread during regular and pre/post hours. I have generated the code as given. During regular hours, I rarely see the label turn green, even though the stock price is going up. Sometimes the label turns black. Also, during pre/post hours , is there a way to see the spread? Please help.
Thanks
Code:
def A = close(priceType = PriceType.ASK);
def B = close(priceType = PriceType.BID);
def spread = B - A;
Addlabel(yes,"Spread : " +Spread ,if spread>=0 then color.green else color.red);