Hello
I need som help here. I have done a search but cant find what I´m looking for
I want a line to show the high and the low between 220000 and 080000
The code I have used is something I found on here but It can only show the line from 000000 to 080000
Any idea how that can bo solved?
if intradaybarindex =0 then
maxprice = 0
minprice = close * 100
endif
tcondition = time>=000000 and time<080100
// Determine daily level
if tcondition then
maxprice = max(maxprice,high)
minprice = min(minprice,low)
Long = maxprice
Short = minprice
endif
return Long as "Long", Short as "Short"
Change line 6 to:
tcondition = time>=220000 or time<080100
Thanks for your answer @vonasi
But it still seems like it resets the value at time 000000
If the high or the low is before 000000 I want that to show the rest of the next day, so to speak
Try this:
once maxprice = 0
once minprice = close * 100
tcondition = time>=000000 or time<080100
// Determine daily level
if tcondition then
maxprice = max(maxprice,high)
minprice = min(minprice,low)
Long = maxprice
Short = minprice
endif
return Long as "Long", Short as "Short"
Then the result looks like this
Sorry but I’m trying to help while doing other things and not actually testing what I write!
Try this:
tcondition = time>=000000 or time<080100
// Determine daily level
if tcondition then
if time = 000000 then
maxprice = 0
minprice = close * 100
endif
maxprice = max(maxprice,high)
minprice = min(minprice,low)
endif
return maxprice as "Long", minprice as "Short"
I completly understand and Im very grateful for your help @vonasi
Now it worked perfectly and exactly as i wanted, only changed time from 000000 to 220000
Again, thank you very much
only changed time from 000000 to 220000
Oooops – too much cutting and pasting by me! Glad it finally works.