Click here to Login





                                                   ShortPrice Impact?

  0

0
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.


No more messages
0




Reply:

No html code. URLs turn into links automatically.

Type in the trading objects you want to include: - Add Objects
To add a trading object in your message, type in the object name, select it and then click on "Add Objects"










QuantShare

Trading Items
Accumulation Swing Index (To measure long term trends)
Optimizable Fibonacci Long and Short Trading System
Large price and volume gain after consolidation
Index Investment Data for U.S. Futures Markets
Coefficient of Determination - R Squared - Time-Series Prediction

How-to Lessons
How to automatically arrange charts?
How to calculate the average of a time series using the money man...
How to create a moving average of an indicator
How to plot the relative performance of several stocks/indices
How to import trades into a portfolio

Related Forum Threads
how can I get MCX commodity charts ?
Fundamental Data For NSE Stocks
Connection with brokers
Forex Scalping using Quantshare?
pivot tables

Blog Posts
Limit and Market orders
Automatically create historical quotes charts
Backtesting Your Trading Systems: Symbol Segmentation
Download historical EOD data for the stock, futures, ETF and Fore...
Trading System: Buy stocks with the highest Sharpe ratio









QuantShare
Product
QuantShare
Features
Create an account
Affiliate Program
Support
Contact Us
Trading Forum
How-to Lessons
Manual
Company
About Us
Privacy
Terms of Use

Copyright © 2024 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items



Trading financial instruments, including foreign exchange on margin, carries a high level of risk and is not suitable for all investors. The high degree of leverage can work against you as well as for you. Before deciding to invest in financial instruments or foreign exchange you should carefully consider your investment objectives, level of experience, and risk appetite. The possibility exists that you could sustain a loss of some or all of your initial investment and therefore you should not invest money that you cannot afford to lose. You should be aware of all the risks associated with trading and seek advice from an independent financial advisor if you have any doubts.