Hi,
With intrabarordergeneration, can I code an exit at a specific time, say 16:14:45, i.e at a precision upto second?
Sa
Time Exit at a Specific Time
- ABC
- Posts: 733
- Joined: Dec 16 2006
- Location: www.abctradinggroup.com
- Has thanked: 126 times
- Been thanked: 415 times
- Contact:
Spaceant,
in general you could do that. However as the code only gets executed when a tick comes in, I would make sure that you allow for the same time or later, just to be sure the exit is done when a tick comes in at 16:44:44 and the next at 16:44:46 only.
Regards,
ABC
in general you could do that. However as the code only gets executed when a tick comes in, I would make sure that you allow for the same time or later, just to be sure the exit is done when a tick comes in at 16:44:44 and the next at 16:44:46 only.
Regards,
ABC
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
if time_s >= xxxx then
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
may i sugggest:
Building Winning Trading Systems with TS
http://www.amazon.com/Building-Winning- ... 904&sr=8-1
Building Winning Trading Systems with TS
http://www.amazon.com/Building-Winning- ... 904&sr=8-1
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
if that's too difficult for you, try this first:
Ask Mr. Easylanguage
http://www.amazon.com/Ask-Mr-Easylangua ... 079&sr=1-1
Ask Mr. Easylanguage
http://www.amazon.com/Ask-Mr-Easylangua ... 079&sr=1-1
TJ,
Thanks, I just on't knwo that there is afunction call Time_S.
Well, I have just switched to use MC for months after using Metastock. I have tried to code the above idea, but have not tested in realtime. Please comment if there is any error.
BTY, I've sent you a PM a long time ago. please check.
Sa
Thanks, I just on't knwo that there is afunction call Time_S.
Well, I have just switched to use MC for months after using Metastock. I have tried to code the above idea, but have not tested in realtime. Please comment if there is any error.
I have not added the respective MarketPosition = 1 (or -1) for Sell and Buy to Cover, as I have tested for end of bar signal, that seems working without them, don't know why.[IntrabarOrderGeneration = True];
Inputs: TT(161445);
Vars: TExit(0);
TExit=Iff(Time_S>=TT,1,0);
If TExit=1 Then Sell ("LX") at Next bar at Close limit;
If TExit=1 Then Buy to Cover ("SX") at Next bar at Close limit;
BTY, I've sent you a PM a long time ago. please check.
Sa
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
TJ,
Thanks, I just on't knwo that there is afunction call Time_S.
...
Sa
time_s is a MultiCharts enhanced EasyLanguage.
It extends the time value to the seconds level.
You will find other _s keywords useful in your sub-minute analysis.
i.e. on tick charts, seconds charts, volume bar charts, etc.
examples of _s keywords
(there are more, this is not the complete list.)
tl_new_s
text_new_s
arw_new_s
CurrentTime_s
DateTime2ELTime_s
ElTimeToDateTime_s
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
... I have tried to code the above idea, but have not tested in realtime. Please comment if there is any error.
...[IntrabarOrderGeneration = True];
Inputs: TT(161445);
Vars: TExit(0);
TExit=Iff(Time_S>=TT,1,0);
If TExit=1 Then Sell ("LX") at Next bar at Close limit;
If TExit=1 Then Buy to Cover ("SX") at Next bar at Close limit;
Sa
looks good from here, but can't tell if it works...
TJ or others,
well, the code seem not workingThe problem is that I am using 5-min chart while I want to have the time exit with an an accuracy upto second, say 9:13:45. I tried it but it seems have the exit on the beginning of the bar
of 9:15.
When I plot the following indicator on a 5-min chart at the time of 9:13:45 am.
Plot1(Time_s)
I indicators 91500, i.e. rounding up to the time as of the end-of-bar.
Time_S doesn't seem to able to count the time upto second in a 5-min chart, but every 5-min. Is that right or am I doing anything wrong?
Any trick that I can do to handle the code in a 5-min chart?
Sa
well, the code seem not workingThe problem is that I am using 5-min chart while I want to have the time exit with an an accuracy upto second, say 9:13:45. I tried it but it seems have the exit on the beginning of the bar
of 9:15.
When I plot the following indicator on a 5-min chart at the time of 9:13:45 am.
Plot1(Time_s)
I indicators 91500, i.e. rounding up to the time as of the end-of-bar.
Time_S doesn't seem to able to count the time upto second in a 5-min chart, but every 5-min. Is that right or am I doing anything wrong?
Any trick that I can do to handle the code in a 5-min chart?
Sa
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
- TJ
- Posts: 7775
- Joined: Aug 29 2006
- Location: Global Citizen
- Has thanked: 1036 times
- Been thanked: 2233 times
download this PowerLanguage help file.
http://www.tssupport.com/multicharts/tu ... nguage.chm
look under Date and Time Routines.
http://www.tssupport.com/multicharts/tu ... nguage.chm
look under Date and Time Routines.
- Andrew Kirillov
- Posts: 1589
- Joined: Jul 28 2005
- Has thanked: 2 times
- Been thanked: 31 times
- Contact:
No, because it depends on the chart resolution. Note that the bar's time is used. So on 5-min chart you will get 161500; you need to use 1-sec chart.With intrabarordergeneration, can I code an exit at a specific time, say 16:14:45, i.e at a precision upto second?
However as the code only gets executed when a tick comes in, I would make sure that you allow for the same time or later, just to be sure the exit is done when a tick comes in at 16:44:44 and the next at 16:44:46 only.
Will this method work if there is no new trade record after the specific time?