Click here to Login

Trading Software Trading objects Features How-to Blog Search


                                                   HOW to write rule?

  0

0
felik
2010-05-23 07:52:31




2) is it possible to write syntax/ rule/ array for the following- stocks with 10and 20 and 30 sma turned up over last n no of day ?Next is for rsi ;
rsi turning up after remaining below30 or flat or negative over last 3days
3) Stocks up 20 % from their last highest high of n no of days ( n may be 10 /20 etc)
4) Stocks down 20 % from their highest high of n no of days
5) Is there any syntax or array to define resistance and support??



QuantShare
2010-05-24 06:51:36

  0

Best Answer
SMA 10, 20 and 30 bars turned up in the last 5 bars:
roc(sma(10), 5) > 0 and roc(sma(20), 5) > 0 and roc(sma(30), 5) > 0 and ref(roc(sma(10), 5), 5) < 0 and ref(roc(sma(20), 5), 5) < 0 and ref(roc(sma(30), 5), 5) < 0

RSI turning up after remaining below30 or flat or negative over last 3days:
rsi(14) > ref(rsi(14), 1) and (istrue(rsi(14) < 30, 3) or roc(rsi(14), 3) <= 0)

Stocks up 20% from their last 20-bar highest high, 10 days ago:
high > 1.2 * ref(hhv(high, 20), 10)

Stocks down 20% from their last 20-bar highest high, 10 days ago:
high < 0.8 * ref(hhv(high, 20), 10)

Horizontal resistance can be defined as the highest close value over N-bar
hhv(close, N)



felik
2010-05-24 14:22:45

  0

Of the above two rules can they be converted into an indicator or trading package with additional condition of and volume 3times of last day vol


QuantShare
2010-05-26 06:37:43

  0

Here are the steps to follow in order to create a trading indicator from the a vector-based formula.

- Select "Tools" then "Create functions".
- Click "Add" and type in your indicator name
- Select the indicator in the left panel
- Type in the following code:
result = cFunctions.CompileFormula("a = rule;").GetVectorDouble("a");
- Replace "rule" by your own rule
- Click on "Save".



felik
2010-05-27 08:34:16

  0

wow thanks u have all solutions



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
How far are the close prices from the support line
Close Price Above Cursor
Number of bars up to the end of the month
Covariance
Dividend Frequency Indicator

How-to Lessons
How to draw distances on a chart?
How to download new quotes when selecting a chart
How to run QuantShare offline
How to create a mobile database/account
How to plot support and resistance lines automatically

Related Forum Threads
how t0 write rule
How do I refer to the close price of another symbol in a formula?
to write and execute an Indicator
How do I find the close price for an entry matching a custom DB
How do I use variables in Money Management Scripts?

Blog Posts
How to create and backtest thousands of trading rules in less tha...
How scripts communicate with each other
How to download the history of dividend payments for stocks in th...
How to choose which technical indicators to use in your trading s...
Step by step on how to get free realtime/delayed data for stocks,...









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 © 2012 QuantShare.com
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
Google+
Follow us on Google+
RSS Trading Items