Click here to Login





                                                   Entry conditions and fields

  0

0
allan nathan
2012-02-02 16:32:46


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)



QuantShare
2012-02-03 04:44:12

  0

Best Answer
It is a different example.


sell = bars since entry>=5;

is equal to:

sell = barssince(buy) >= 5;



allan nathan
2012-02-03 13:05:00

  0

thanks,i now see it in the QS programming language docs..

thanks,

allan



Stefan Jones
2012-05-30 05:29:27

  0

Hi

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?

Thanks
Stefan



QuantShare
2012-05-30 10:04:46

  0

Hi,

"barssince" returns the number of bars since a condition is true.
"buy" is simply a variable. You can pass any condition to the "barssince" rule.

Example:
a = barssince(cross(close, sma(30)); => Returns the number of bars since the price crosses above its 30-bar moving average

If you want to exit a position after 2 bars, I suggest you use the N-Bar stop.




Stefan Jones
2012-05-31 04:08:34

  0

Many thanks!


Stefan Jones
2012-05-31 04:57:42

  0

Hi

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.

Is this a bug?



QuantShare
2012-05-31 06:07:20

  0

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"




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
Staggered Entry and Exit Strategy
Entry Price and Exit Price in Trading System Report
ADS Business Conditions Index
Bulls and Bears Strategy
Consolidation Breakout and Congestion Index

How-to Lessons
How to create and trade a Neural Network model
How to download EOD quotes for active and valid stocks only
How to create trading rules based on Put and Call volume data
How to plot support and resistance lines automatically
Difference between the watchlist and the screener tools

Related Forum Threads
How do you retrieve the entry and exit price for a position?
MM Staggered Entry and Exit
Adjust the Entry and exit prices of trades in AMM script
Entry and Exit in Rule manager analyzer
Trading System Target Profit and Loss prices

Blog Posts
Charting, Backtesting and Trading using Fundamental Data
Trend Following and Moving Averages
Backtesting a Strategy Based on Bond and Stock Index ETFs
How to predict and trade the stock market using pivot points
Fundamental Screen based on Stock price, ROI and Market capitaliz...









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.