In Hong Kong market, the market close time became 1630 after 25 Jul 2017, before that was 1615, the logic likes:
if date >= “20170725” then
close_time = “1630”
else
close_time = “1615”;
How can I set the date format for date comparison in backtest? I tried the below function but doesn’t work.
FormatDate("yyyyMMdd", ELDateToDateTime(currentdate))} >= “20200725”
Date comparison [SOLVED]
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
In Hong Kong market, the market close time became 1630 after 25 Jul 2017, before that was 1615, the logic likes:
How can I set the date format for date comparison in backtest? I tried the below function but doesn’t work.
Code: Select all
if date >= “20170725” then
close_time = “1630”
else
close_time = “1615”;
Code: Select all
FormatDate("yyyyMMdd", ELDateToDateTime(currentdate))} >= “20200725”
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
Please go to wiki and look up the definition of DATE.
There usage examples you can copy.
There usage examples you can copy.
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
Go to the top of this page,Hi TJ, can you show me the wiki link?
Look for the SUPPORT tab,
put your mouse over the tab,
a new window will show up.
The 4th heading from the left is "Online Help & Wiki"
https://www.multicharts.com/trading-sof ... /Main_Page
Go to #8 in the table of contents
8 PowerLanguage Keyword Reference
Look under:
Data Information/General (77 P)
Hi TJ,
Thanks for your information, I have checked the page of both “Data Information/General (77 P)” and “Date and Time Routines (55 P)”, the example is quick simple, I cannot find any example of date comparison, may I check if anything I missed?
Thanks for your information, I have checked the page of both “Data Information/General (77 P)” and “Date and Time Routines (55 P)”, the example is quick simple, I cannot find any example of date comparison, may I check if anything I missed?
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
First, you need to study the definition of DATE.
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
Study again.Hi TJ,
I have already studied the function of DATE from "Date and Time Routines (55 P)”, the example is quite simple, don't mention any comparison scenarios.
Go to #8 in the table of contents
8 PowerLanguage Keyword Reference
Look under:
Data Information/General (77 P)
Please go to wiki and look up the definition of DATE.
-
- Posts: 36
- Joined: Sep 03 2013
- Location: Chicago, IL
- Has thanked: 14 times
- Been thanked: 12 times
Hi Kinwai,
Your code doesn't follow the proper format for date.
It's in the definition and examples are provided.
Check it again and change your code to conform to the proper format.
I'm sure it will work out after you do that!
Your code doesn't follow the proper format for date.
It's in the definition and examples are provided.
Check it again and change your code to conform to the proper format.
I'm sure it will work out after you do that!