Click here to Login





                                                   SetSimTiming function parameters & usage

  0

0
chaz
2013-09-14 01:59:06


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

Many thanks in advance,
Chaz




clonex
2013-09-16 14:53:21

  0

Proper explanation is:

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

Clonex



chaz
2013-09-18 00:23:00

  0

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.

Thx in advance,
Chaz



clonex
2013-09-18 12:41:34

  0

Hi,

Please try to post a piece of code of your strategy.
The problem i see for example:

If you have a strategy::

SetSimTiming(_Buy, _Open, -1)
buy = close>sma(20);

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)

Clonex



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
NORMDIST - Normal Probability Density Function
Choose function
Day of week and Week number function
Swing Point Function (SP)
Advanced Quotes and Custom Databases Function

How-to Lessons
How to display two stocks on the same chart
How to calculate the average of a time series using the money man...
How to plot arrows below/above candlesticks on a chart
How to create a hatched area in a chart
How to optimize a neural network using a genetic algorithm

Related Forum Threads
Parameters
Interpretation of " DRAWDOWNEQ" function
TimeframeApply function
Adv. Money Management & Intraday data
Count() with STDdev function anomoly

Blog Posts
The 'inside period' function
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...
Detect chart patterns using the auto support/resistance indicator









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.