I am working with a strategy that measures the change in the current close compared to a specific time of day.
For example: (current close - 10:30am close) / 10:30am close
How do I refer to this 10:30 am close?
Thank you
Size:
Color:
Get the date/time from Bars[bar].Date while looping bar by bar, and on how to determine that bar see the FAQ:
FAQ | Strategies and WealthScript > "How do I code a rule for time of the day?"
Size:
Color:
Thanks Eugene. I may be completely off track here, but am I able to assign the value to a variable using something like this and then refer back to this as part of the entry condition?
CODE:
Please log in to see this code.
Size:
Color:
Sure.
Size:
Color:
First step, I would like to just chart the value of 'xClose'. Ive attempted the following based on some other examples but receive an error' CS0103 @(30,28) the name xClose is not valid in this context' (I use Japanese windows so this is a rough translation).
Any hints as to what I am doing wrong or what the correct format should be for this? In its current format it should be a very simple indicator that keeps track of the 10:30am close through out the day
CODE:
Please log in to see this code.
Size:
Color:
You're mixing up a double value with a DataSeries.
Create a new blank DataSeries. Check the time condition, if it's true then assign the Close to the DataSeries at the current bar. Then you'll be able to plot the new DataSeries.
For examples, start from the WealthScript Programming Guide.
Size:
Color:
Eugene, by 'create a new blank DataSeries', are you referring to the How to: Create a "semi-formal" Custom Indicator?
Thank you
Size:
Color:
Not necessarily. See DataSeries > Filling a Custom DataSeries. Use the technique in Example 2.
Size:
Color:
Thanks Cone (and Eugene). I believe I am almost where I want to be, The following returns the value at the specified time. However apart from that specific time, it returns 0, I am trying to carry the value the following day at 10:30 when it will be updated to the new 10:20 close price.
CODE:
Please log in to see this code.
Size:
Color:
Thanks Cone (and Eugene). I believe I am almost where I want to be, The following returns the value at the specified time. However apart from that specific time, it returns 0, I am trying to carry the value the following day at 10:30 when it will be updated to the new 10:30 close price.
CODE:
Please log in to see this code.
Size:
Color:
CODE:
Please log in to see this code.
Size:
Color:
Thank you both for your time, not only did I plot the data I needed, I learnt a few things too.
CODE:
Please log in to see this code.
Size:
Color: