Can anyone provide a more comprehensive description of SetSimTiming() function and code example how to use it properly with intraday/real-time data.
In QuantshareLanguage.pdf documentatioin it says:
SetSimTiming( ENUM entry type, ENUM entry price, ARRAY decalage (1 to execute the next bar)) ex SetSimTiming(_Buy, _Open, 1)
In trading System "Trading System based on the Previous Week SPY Return
SetSimTiming(_Buy, _Open, 0); Note says that decalage = "0" is going to execute buy on next bar open
SetSimTiming(_Sell, _Close, -1); and here decalage = "-1" is going to make sell at close of today (current bar).
SetSimTiming(_Buy, _Open, 0); Note says that decalage = "0" is going to execute buy on next bar open
SetSimTiming(_Sell, _Close, -1); and here decalage = "-1" is going to make sell at close of today (current bar).
Hi Clonex,
Thank you for replying.
So having 1 min intraday data fed into QS Intraday DB, if I use SetSimTiming(_Buy, _Open, -1) and run simulator in the second minute of the 20 minutes bar I should see a buy made for that bar if there was a security meeting the buy rule (top ranked stock out of the ranking system & capital is available).
Can you clarify if at a bar _close/_open order is executed or only buy/sell signal generated.
problem is that simulator buys on open on same bar where is condition meet. That is in real life not possible. You have to use SetSimTiming(_Buy, _Open, 0). Buy on open of next bar. ( Bar N = confition has met; Bar N+1 buy on open)
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.