|
Dave W.
2014-02-09 01:33:58
|
|
If I set my system to short at the open:
SetSimTiming(_Short, _Open, 0);
and I happen to have a the following statements in the simulator:
PriceFactor = 0.90;
TriggerHoldDays = 2;
ShortPrice(close * PriceFactor ,TriggerHoldDays );
is the "ShortPrice()" statement impacting the short price?
|
|
|
|
QuantShare
2014-02-11 14:31:25
0
|
|
The answer is NO.
It is impacting only if you are using a limit, stop or stoplimit orders.
|
|
|
|
Dave W.
2014-02-13 03:17:32
0
|
|
Ok. I think there is a bug, then.
For example, on a system I'm testing, let's say I use the following code on one version.
SetSimTiming(_Short, _Open, 0);
PriceFactor = 0.90;
TriggerHoldDays = 2;
ShortPrice(close * PriceFactor ,TriggerHoldDays );
Then, I create a copy and make no changes except that I comment-out the ShortPrice line. The performance on the copy is different than on the original.
|
|
|
|
QuantShare
2014-02-13 11:30:26
0
|
|
Best Answer
I see no bug here. I tried this and got exactly the same result for both systems.
Please send us your formula by email so that we can check it
|
|
|
|
Dave W.
2014-02-28 16:08:25
0
|
|
Not urgent, but curious if you validated the issue I was seeing with the information I sent you.
|
|
|
|
QuantShare
2014-03-01 11:17:45
0
|
|
I did create a trading system, backtested it then commented out the "ShortPrice" line and did another backtest. I got exactly the same result.
|
|
|
|
Dave W.
2014-03-01 19:44:08
0
|
|
Weird. Ok...
|
|
|
|
SystemTrade
2014-03-03 17:18:28
0
|
|
@ QS
I don't know about Dave's configuration, but I can reproduce the issue when I use "setting_SimulatorRegularRead=0" in data.txt.
Hope this helps.
|
|
|
|
QuantShare
2014-03-04 11:38:39
0
|
|
What formula did you use? What happens when this field is set to 1?
|
|
|
|
SystemTrade
2014-03-04 18:22:03
0
|
|
I simply use:
SetSimTiming(_Short, _Open, 0);
ShortPrice(close, 2);
Short = 1;
with the ShortPrice line commented or not.
Please ignore my first comment regarding the "setting_SimulatorRegularRead" line as meanwhile I can reproduce the issue also with this line set to 1.
I now think that the different output is related to the last parameter of the ShortPrice-function (valid for bars) and some orders are cancelled before the market opens.
Example 1:
On Oct 29 and 30, 2012 (Monday and Tuesday) NYSE was closed due to the hurricane Sandy. When I take a portfolio consisting of AA (Alcoa) and AAL.L (Anglo American listed in London where markets had been open those days) only with a time frame from Oct 26, 2012 to Nov 15, 2012 for instance, then the signal from Oct 26 (Friday) for AA
a) will be executed on Oct 31 in case of "ShortPrice(close, 5);" or "ShortPrice(close, -1);" or by just dropping this line (assuming there is 5 bars in default Capital settings)
b) will not be executed in case of "ShortPrice(close, 2);" because the order is no longer valid on Oct 31. The execution you will see on Nov 1 is from another signal (Oct 31). The two bars for Oct 29 and 30 will be considered valid bars for AA even though the market was closed for AA.
This should explain differences in performance.
Example 2:
If I do the same but just with the single symbol AA in my portfolio (or only with symbols that were all not tradable on 29th and 30th, I will NOT see differences in performance. In this case Oct 29 and 30 bars will NOT be considered valid bars.
It seems as if the parameter "valid for bars" is NOT interpreted on the level of a single symbol BUT on portfolio level. I don't know if it would be worth having a parameter to determine the logic.
Btw: the same happens with the BuyPrice function
|
|
|
|
QuantShare
2014-03-05 12:46:06
0
|
|
Thanks. Yes, you are right I missed the (valid for bars).
If you use a different value than the default value (5) then you may get different results due to the factor you explained.
Thank you again.
|
|
|
|
Dave W.
2014-03-05 18:15:31
0
|
|
Thanks SystemTra.de. Very helpful.
|
|
|
|