Welcome to NexusFi: the best trading community on the planet, with over 150,000 members Sign Up Now for Free
Genuine reviews from real traders, not fake reviews from stealth vendors
Quality education from leading professional traders
We are a friendly, helpful, and positive community
We do not tolerate rude behavior, trolling, or vendors advertising in posts
We are here to help, just let us know what you need
You'll need to register in order to view the content of the threads and start contributing to our community. It's free for basic access, or support us by becoming an Elite Member -- see if you qualify for a discount below.
-- Big Mike, Site Administrator
(If you already have an account, login at the top of the page)
I want to enhance the Title section of my charts by inserting the day of the week in front of the date: Friday, 12/30/2011.
The DayOfWeek() returns a number. So I need to convert the number to text that says what day it is.
Here is the code I have so far:
for( n = 0; n < 10; n++ )
{
printf("Current n = %f\n", n );
varDayOfWeek = DayOfWeek();
switch(varDayOfWeek)
{
case 0:
varDayOnChart == "Sunday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
case 1:
varDayOnChart == "Monday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
case 2:
varDayOnChart == "Tuesday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
case 3:
varDayOnChart == "Wednesday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
case 4:
varDayOnChart == "Thursday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
}
The error occurs on the last line. The "}" is highlighted and the error message is : Syntax error, unexpected send. Is there semicolon missing at end of the previous line?"
Anyone who can help shed some light on fixing this?
Can you help answer these questions from other members on NexusFi?
case 0:
{
varDayOnChart == "Sunday";
printf("Day of week is ") + varDayOnChart + "\n";
break;
}
}
But don't have AmiBroker or a C++ compiler, so can't say for sure if that is the syntax problem.
It has been a while since I used C++, but you should check strftime and you can format the time and just use a single deceleration with no switch statement.