"Below is how I'm trying to calculate the number of days since the last server day."
should read
"...number of days from the last/current server day to the day the VLINE is on."
Yep, worked a charm. Thanks.
brettosm8: Yep, worked a charm. Thanks.
Except it returns the number of bars ago, not the number of days ago, which was your original question.
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Hi there,
I put a VLINE and 2 HLINEs on a chart.
The VLINE is the day a signal occurs that I want to trade.
The HLINE's are profit targets.
I want to calcuate the high or low of the bar I dop the VLINE on because that will be the signal invalidation value. If price reaches it before positions are opened the orders to open should be deleted.
Below is how I'm trying to calculate the number of days since the last server day. I'm only looking at vertical line at the moment.
I place a vline on the most right bar with a result of 1. For every bar I move to the left the result increases by 1 until when the result should read 6 but reads 8.
The below captures show the prints from the most right bar and moving left.
Got any idea how to get consistant result or approach the whole thing better?
Thanks.