1 registered members (opm),
778
guests, and 4
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Duplicate elements in all_trades w/ Entry + EntryTime limits
#446526
10/20/14 02:37
10/20/14 02:37
|
Joined: Sep 2013
Posts: 504 California
GPEngine
OP
User
|
OP
User
Joined: Sep 2013
Posts: 504
California
|
This simple Strategy does enterLong unconditionally at every bar. Then in EXITRUN it prints to file one line for every value in the all_trades list. I ran it against EUR/USD using official data. Then I analyzed the output, counting the occurrences of Bar# in the file. Observed: Repeated values for Bar # in the output, each with different values for TradeProfit. Expected: No more than one value per bar in the simulation, with an reliable & final value for TradeProfit..
#define BUFFSIZE_S 300
char value[BUFFSIZE_S];
function write_line() {
sprintf(value, "%u,%f\n", TradeBarOpen, (var)TradeUnits);
file_append("all_trades.txt", value);
}
function run() {
StartDate = 20140801;
EndDate = 20140901;
EntryTime = 2;
var atrx = ATR(200);
Entry = atrx * 1.0;
Stop = atrx * 3.5;
if (is(INITRUN)) {
file_delete("all_trades.txt");
}
enterLong();
if (is(EXITRUN)) {
for (all_trades) {
write_line();
}
}
}
$ cut -d',' -f1 all_trades.txt | sort | uniq -c | sort -rn | head
3 807
2 993
2 990
2 985
2 972
2 957
2 953
2 921
2 836
2 783
$ grep 807 all_trades.txt
807,772.900024,0.000000
807,772.900024,-2.858410
807,772.900024,-2.866854
What's happening, here?
|
|
|
Re: Duplicate elements in all_trades w/ Entry + EntryTime limits
[Re: jcl]
#446620
10/23/14 14:23
10/23/14 14:23
|
Joined: Sep 2013
Posts: 504 California
GPEngine
OP
User
|
OP
User
Joined: Sep 2013
Posts: 504
California
|
Good guess, but no. With EntryTime = 1, there is only at most 1 trade opened per bar, including 807.
$ grep 807 all_trades.txt
807,772.900024,-2.866854
According to your description, with one enter* command per bar, - With EntryTime = 2, at a given bar opened trades could come from the current, the previous, and the previous-plus-one bar
- With EntryTime = 1, at a given bar opened trades could come from the current, and the previous bar
This implies that - With EntryTime = 0, at a given bar opened trades could come from the current bar
But a simple test proves that EntryTime = 0 makes Zorro NEVER enter any trades.
|
|
|
|