I have a question about writing EL
In most cases, the first tick of the day involves a big gap change.
Sometimes I would like to skip it for the calculation of a signal.
Is it possible to skip the first tick of the day?
HR
[PL/EL] How to skip the first tick of the day?
- TJ
- Posts: 7745
- Joined: 29 Aug 2006
- Location: Global Citizen
- Has thanked: 1033 times
- Been thanked: 2224 times
<Date>, <Time>, <Close>, <Volume>
2009-06-13,09:00,180.10,620
2009-06-13,09:01,180.15,55
2009-06-13,09:01,180.15,36
2009-06-13,09:01,180.15,19
2009-06-13,09:01,180.20,88
2009-06-13,09:02,180.10,42
2009-06-13,09:06,180.10,34
2009-06-13,09:07,180.10,42
2009-06-13,09:07,180.15,27
2009-06-13,09:07,180.15,15
--------------------------------- first 10 ticks
2009-06-13,09:08,180.15,55
2009-06-13,09:17,180.15,30
2009-06-13,09:17,180.20,23
2009-06-13,09:17,180.20,36
2009-06-13,09:18,180.25,20
2009-06-13,09:18,180.20,11
2009-06-13,09:18,180.25,20
2009-06-13,09:18,180.20,17
2009-06-13,09:19,180.25,44
2009-06-13,09:19,180.25,17
-------------------------------- second 10 ticks
2009-06-13,09:19,180.25,26
2009-06-13,09:19,180.20,32
2009-06-13,09:19,180.20,85
2009-06-13,09:19,180.15,26
2009-06-13,09:19,180.15,26
The first bold line is the first tick of the day.
I need to plot a 10-tick chart(with TradeVolume on) and ceate an indicator and a signal to calculate the accumulated up volumes and down volumes. The only limitation is to exclude the first line, the first tick of the day, for calculation.
I tried a bit, but failed to filter the first tick of the day.
Can someone write a code for this please?
Thank you.
HR
2009-06-13,09:00,180.10,620
2009-06-13,09:01,180.15,55
2009-06-13,09:01,180.15,36
2009-06-13,09:01,180.15,19
2009-06-13,09:01,180.20,88
2009-06-13,09:02,180.10,42
2009-06-13,09:06,180.10,34
2009-06-13,09:07,180.10,42
2009-06-13,09:07,180.15,27
2009-06-13,09:07,180.15,15
--------------------------------- first 10 ticks
2009-06-13,09:08,180.15,55
2009-06-13,09:17,180.15,30
2009-06-13,09:17,180.20,23
2009-06-13,09:17,180.20,36
2009-06-13,09:18,180.25,20
2009-06-13,09:18,180.20,11
2009-06-13,09:18,180.25,20
2009-06-13,09:18,180.20,17
2009-06-13,09:19,180.25,44
2009-06-13,09:19,180.25,17
-------------------------------- second 10 ticks
2009-06-13,09:19,180.25,26
2009-06-13,09:19,180.20,32
2009-06-13,09:19,180.20,85
2009-06-13,09:19,180.15,26
2009-06-13,09:19,180.15,26
The first bold line is the first tick of the day.
I need to plot a 10-tick chart(with TradeVolume on) and ceate an indicator and a signal to calculate the accumulated up volumes and down volumes. The only limitation is to exclude the first line, the first tick of the day, for calculation.
I tried a bit, but failed to filter the first tick of the day.
Can someone write a code for this please?
Thank you.
HR
- ABC
- Posts: 723
- Joined: 16 Dec 2006
- Location: www.abctradinggroup.com
- Has thanked: 125 times
- Been thanked: 410 times
- Contact:
variables: intrabarpersist mydate(0), intrabarpersist skip(False);
variables: intrabarpersist uv(0), intrabarpersist dv(0);
skip = False;
if Date <> mydate then begin
mydate = Date;
uv = 0;
dv = 0;
skip = true;
end;
if not skip then begin
uv += UpTicks;
dv += DownTicks;
plot1(uv, "uv");
plot2(dv, "dv");
end;
Will this indicator plot accumulated upvol/downvol excluding the very first tick of the day?
I appied to a 10 tick chart, but I am not confident if it is right or not?
Please some one try and verify this works.
HR
variables: intrabarpersist uv(0), intrabarpersist dv(0);
skip = False;
if Date <> mydate then begin
mydate = Date;
uv = 0;
dv = 0;
skip = true;
end;
if not skip then begin
uv += UpTicks;
dv += DownTicks;
plot1(uv, "uv");
plot2(dv, "dv");
end;
Will this indicator plot accumulated upvol/downvol excluding the very first tick of the day?
I appied to a 10 tick chart, but I am not confident if it is right or not?
Please some one try and verify this works.
HR
Thank you SUPER,
Some questions.
[1] Will this code work for a signal too if I replace the plot statemenst with buy/sell statement as shown below? Do I need to use IOG?
[2] Will these code using IntrabarPersist and/or IntrabarOrderGeneraton work the same for history data?
HR
Some questions.
[1] Will this code work for a signal too if I replace the plot statemenst with buy/sell statement as shown below? Do I need to use IOG?
Code: Select all
variables: intrabarpersist skip(0);
variables: intrabarpersist uv(0), intrabarpersist dv(0);
if Date<>Date[1] then skip=0;
skip = skip + 1;
if skip >=1 then begin
uv += UpTicks;
dv += DownTicks;
buy at market;
end;
HR