In the indicator below i want to be able to capture or store in a variable the prices at which the Buy and Sell are printed on the chart.
See screenshot attached, i want to test the prices and compare before printing the next signals.
MyLongConditions = close CROSSES OVER BollingerDOWN[20]
MyShortConditions = close CROSSES UNDER BollingerUP[20]
IF MyShortConditions THEN
DrawText("Sell",barIndex, high + range*2,serif,bold,15) coloured(255,0,0,255)
ELSIF MyLongConditions THEN
DrawText("Buy",barIndex, low - range*2,serif,bold,15) coloured(0,128,0,135)
ENDIF
RETURN
Save it into a variable:
MyLongConditions = close CROSSES OVER BollingerDOWN[20]
MyShortConditions = close CROSSES UNDER BollingerUP[20]
IF MyShortConditions THEN
DrawText("Sell",barIndex, high + range*2,serif,bold,15) coloured(255,0,0,255)
buysignalprice = high+range*2
ELSIF MyLongConditions THEN
DrawText("Buy",barIndex, low - range*2,serif,bold,15) coloured(0,128,0,135)
sellsignalprice = low-range*2
ENDIF
RETURN
@jkadda
Do not double post. Ask your question only once and only in one forum. All double posts will be deleted anyway so posting the same question multiple times will just be wasting your own time and will not get you an answer any quicker. Double posting just creates confusion in the forums.