I was testing a very simple script;
if (getMostRecentTrade() == getMostRecentAsk()){
drawTextPixel(200, 200, " "+getMostRecentTrade()+" ", Color.green, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "Trade");
drawTextPixel(300, 200, " "+getMostRecentTradeSize()+" ", Color.green, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "TradeS");
}
else if (getMostRecentTrade() == getMostRecentBid()){
drawTextPixel(200, 200, " "+getMostRecentTrade()+" ", Color.red, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "Trade");
drawTextPixel(300, 200, " "+getMostRecentTradeSize()+" ", Color.red, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "TradeS");
I tried the script on various timescales, and Tick chart seemed the best for responsiveness. The problem appears occasionally when the values are correctly rendered when compared with Time & Sales, but the color is inverted.
For example an ASK comes through T&S and the values are correctly updated, but the colour represents a BID. I've attached an image example.
Any ideas why this might be?
if (getMostRecentTrade() == getMostRecentAsk()){
drawTextPixel(200, 200, " "+getMostRecentTrade()+" ", Color.green, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "Trade");
drawTextPixel(300, 200, " "+getMostRecentTradeSize()+" ", Color.green, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "TradeS");
}
else if (getMostRecentTrade() == getMostRecentBid()){
drawTextPixel(200, 200, " "+getMostRecentTrade()+" ", Color.red, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "Trade");
drawTextPixel(300, 200, " "+getMostRecentTradeSize()+" ", Color.red, Color.white,Text.BOLD|Text.FRAME| Text.RELATIVETOTOP|Text.RIGHT, "Arial", 15, "TradeS");
I tried the script on various timescales, and Tick chart seemed the best for responsiveness. The problem appears occasionally when the values are correctly rendered when compared with Time & Sales, but the color is inverted.
For example an ASK comes through T&S and the values are correctly updated, but the colour represents a BID. I've attached an image example.
Any ideas why this might be?
Comment