Next question.
I cannot understand why the attached code does not execute the way I want it to.
Basically, I want a buy button drawn if PSL < open0 and a sell button drawn if PSL>open. Despite my many effort , BOTH buttons continue to be drawn.
Could someone point me in the correct direction please?
both both
I cannot understand why the attached code does not execute the way I want it to.
Basically, I want a buy button drawn if PSL < open0 and a sell button drawn if PSL>open. Despite my many effort , BOTH buttons continue to be drawn.
Could someone point me in the correct direction please?
Code:
function main(){ var PSL = 51.80 var Chase = .02 var bLng var nAsk var nBid if (open(0) > PSL) { bLng = true; nEntry = (nAsk +Chase); DrawBuy(); } else { bLng = false; nEntry = (nBid -Chase); DrawSell(); debugPrintln(bLng) } } function DrawBuy(){ drawTextPixel(20, 65, " Buy @URL=EFS:BuyCallBack", Color.white, Color.green, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.BOLD | Text.CENTER, "Arial", 12, "OB"); } function DrawSell(){ drawTextPixel(20, 40, " Sell @URL=EFS:SellCallBack", Color.white, Color.red, Text.RELATIVETOLEFT | Text.RELATIVETOBOTTOM | Text.FRAME | Text.ONTOP | Text.BOLD | Text.CENTER, "Arial", 12, "OS"); }
Comment