3

I have worked out the daily bars range, say from high-low.

I want to be able to say 'From todays open, if the price goes up 50% of yesterdays range then go long.

Saw some people say 'close' is the word for current price, but I don't want to wait for the daily candle to close, I want to enter that long as price hits that 50% during the day.

Just cant figure out how to put that into my code, any ideas or help would be great, thanks

candlestickb
  • 37
  • 1
  • 6

1 Answers1

5

close refers to current price in real-time. With every new price change, its value will be updated to the latest price value.

Just plot close and watch it in real-time and you will see.

vitruvius
  • 15,740
  • 3
  • 16
  • 26
  • Thanks, I have tried this but still not working sadly. I'm trying to get this code to work - Range = high - close percentofRange = (i_percentRange / 100) * Range[1] // Buy Conditions var float buyPrice = 0 buyCondition = close > percentofRange[1] and strategy.position_size == 0 and f_dateFilter – candlestickb Aug 23 '22 at 07:26
  • Also, I am backtesting, not real time / forward testing – candlestickb Aug 23 '22 at 10:08
  • If it's not real time, you won't be having the tick information. Tradingview only has Open, Close, High, Low price values on the historical bars. – vitruvius Aug 23 '22 at 11:12
  • Ok all good. If im on the daily chart then, and I have 'use bar magnifier' on, will it enter my trade intra day still, and how far down will bar magnifier go if im on the daily chart? Thanks – candlestickb Aug 23 '22 at 13:02