have a couple of questions..I am looking for fields,"bars since entry" as in sell = bars since entry>=5;
also,in written example you give
min profit=20
max dd=10
min # bars=10
max#bars=100
At the bottom of the page you
EXAMPLE BSignalLong(30, -10, -1, 300)
Is that a different example or typos?
Allan
SYNTAX BSignalLong( ARRAY min profit, ARRAY max drawdown, ARRAY minimum days, ARRAY maximum days)
RETURNS NUMERIC ARRAY
DESCRIPTION Gives you the best long entries and exits depending on the parameters you
choose
Example if you choose a minimum profit of 20 percent, a maximum drawdown
of 10 percent,
a minimum number of bars equal to 10 and a maximum number of bars equal
to 100
The system will give you the most profitable trades that meet these criteria
Plot the returned array in a graph that contains CandleStick data to see entries
and exits arrows
Click on those arrows to see additional information
ADDITIONAL
INFO
EXAMPLE BSignalLong(30, -10, -1, 300)
I have tried implementing a rule similar to the above (sell = barssince(buy) ==2;), but it does not seem to work properly. There are many trades generated by the simulator having number of bars of 4,5,6 etc even 14! Can you tell me how this function works? What is the 'buy' variable/vector being passed to barssince?
A related question.... ok so I have set up a trading system which enters on an RSI(2) of < 25 and sells 2 bars later. When I backtest there are some sell dates in the trades list which do not exist in the database (i.e. they are weekend days usually). It seems that the backtester is counting weekends as non-tradeable bars and selling the positions early instead of waiting for the next 'true' (i.e. tradeable) day.
eg FTSE100 index
buy on 17 Dec 2009 (thursday) at close
sell on close 2 bars later
this should sell on Dec 21st at close (a monday), as that is 2 trading bars later.
instead it sells the next day at close (dec 18th - friday). this is odd because:
- it's trading early rather than waiting for the 2 trading bars (days) to elapse in order to sell on monday
- the price listed for the trade is the Dec 18th price, and is shown as occurring on Dec 18th on the chart, but in the backtester's list of trades, the exit trade is listed as occurring on Dec 20th which was a sunday, is more than 2 bars (of any type) later, and is a date which doesn't exist in the database.
The simulator do not count weekends when using N-bar stop (as they are not data on these days).
If you are buying at "close of today" then the simulator will count this bar.
If you are buying at "open of tomorrow" then the simulator will begin counting bars starting from the next bar.
If this doesn't fix your issue then please send your trading system to support at quantshare.com
You find the trading system file, by selecting "Help -> Trading Object Paths -> Trading System"
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.