WHRoeder only says to read the manual. As I said I've already read the manual before I even posted my question in Post #6. All those time & date functions return with real time values, not past values. My question is how do I find past values ? but I guess this isn't the forum for asking such help - sorry.
You should read better
Forum on trading, automated trading systems and testing trading strategies
Sunday night price bars
whroeder1, 2017.01.11 15:49
I did read better. I wish you could understand my problem better. The examples given in the manual show that the date is specified manually, rather than the system code determining that date. If I have to tell it the exact date of every Sunday for the last 5 years, I'll be writing 260 lines of code to tell it every Sunday date. That doesn't make sense.
All I'm asking is a little help - i.e. how do I get the function to go through each bar on the chart to determine its DayOfWeek, as opposed to writing 260 lines of code telling the code which days are Sundays ?
Sorry to be a pain. If you ever come over to the Tradestation forums, I'll help you write any code you want, but I'm floundering here with this C language stuff.
Sorry - I was implying that I read the manual, and have tried the "actual" function you linked to. I've been toying with that same function for 2 days, but I'm getting nowhere. What I don't understand is how to have it tell me past values, because the only example it gives is when you manually tell it the Gregorian date. And really, what's the point of that. I want the program to figure them out so I don't have to write 260 lines testing for every Sunday for 5 years.
I'm not asking you to code my program. I'm just asking you to throw me a bone, to get me over this hurdle that I'm obviously missing something, maybe due to my unfamiliarity with the C language. You asked me to post my coding attempt. OK here's one of many attempts. Thanks
You can modify this code