Click here to Login





                                                   Use Screener to Find Potential Splits?

  0

0
Dave W.
2014-02-25 19:08:46


I'm attempting to use the screener to identify splits in symbols I'm interested in so I can apply those splits using the built-in QuantShare split functionality. I've populated the split custom database and come up with the following screener code:

BarsToEvaluate = 500; // Look at the last 500 bars for splits
SplitRatio = GetData('splits', 'ratio', Zero);
filter = hhv(SplitRatio , BarsToEvaluate );

AddColumn('Ratio', GetData('splits', 'ratio', LastData));
AddColumn('Announced', GetData('splits', 'announced', LastData));
AddColumn('Date', GetData('splits', 'Date', LastData));

This screener code seems to properly identify splits and returns the split ratio as expected, but I can't get it to return the other column values (i.e., the announced column and the Date column) from the custom split database. Can you help?

Thanks,
Dave



QuantShare
2014-02-26 13:01:13

  0

Hi Dave,

Make sure the "announced" column exists. If it is a "string" then use: GetDataString('splits', 'announced', '')

To get the date, use "date()" function. This is because the custom database data is synchronized with the quotes data.




Dave W.
2014-02-26 19:22:22

  0

Hi and thanks for the suggestions - I validated that the database and field exist, and the field is a string. I'm happy to share this code on the server if I can get it working, but it isn't there yet.

I think what is happening is I'm able to identify the highest SplitRatio using the hhv function, but I don't know how to identify the same bar for the remaining columns. For example, when I use the Date() function you mentioned, I get today's date, not the date when the condition occurred.

I've tried 50 different permutations of various functions (some shown commented-out below) to identify and present the date and announced fields on the same bar the condition (i.e., hhv(SplitRatio , BarsToEvaluate ) ) was true. How can I do that?


BarsToEvaluate = 500;
SplitRatio = GetData('splits', 'ratio', Zero);
SplitAnnounced = GetDataString('splits', 'announced', '');
filter = hhv(SplitRatio , BarsToEvaluate ) ;


AddColumn('Ratio', GetData('splits', 'ratio', LastData));
AddColumn('Announced', SplitAnnounced);
AddColumn('Date', date() );

// Various options tried but not returning desired values
SplitAnnounced = GetDataAdv("splits","announced","","hhv(SplitRatio,BarsToEvaluate)");
//AddColumn('Announced', LastNotNullValue(SplitAnnounced) );
//AddColumn('Announced', LastValue(SplitAnnounced) );
//AddColumn('Announced', GetDataAdv('splits', 'announced', '', 'last');
//AddColumn('Announced', GetDataString("splits", "announced", '' ));
//AddColumn('Announced', SplitAnnounced );
//BarWhenSplitHappened = BarsSince( hhv(SplitRatio , BarsToEvaluate ) ==1 );
//AddColumn('BarNum', BarWhenSplitHappened);




QuantShare
2014-02-27 11:58:54

  0

Best Answer
Hi Dave,

First, download this function to reference previous value of "string" variables: RefString.

To get the date of last split ratio, type:

date1 = refstring(date(), barssince(SplitRatio));

To get the last split ratio type:

splitratio1 = ref(SplitRatio, NaNtoZero(barssince(SplitRatio), 1));





RefString (by QuantShare, uploaded several months ago)
No notes

Rate an item Rate an item Rate an item Rate an item Rate an item Number of downloads Notes Report an item

Dave W.
2014-02-27 17:47:04

  0

Excellent. Thanks for the new function. I've shared / uploaded the updated screener script which is worked perfectly now.


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
Covered Call Screener
Covered Put Screener
Identify Spilts Screener Script
Number of Potential Splits per Trading Day
Detect and Display Potential Splits on a Chart

How-to Lessons
How to use the Fibonacci retracement drawing tool
Difference between the watchlist and the screener tools
How to download and use U.S. stocks earnings data
How to use QuantShare with Metastock data
How to use a custom drawing tool

Related Forum Threads
use of screener for applied rules
Looping within a screener and how to use RemoveSameSignals
Screener
Scripts to Find Data Errors
how to use the intraday downloader

Blog Posts
How to use QuantShare screener to trade penny stocks
How to Download and Use Fundamental Data
10 masks to create thousands of rules to use into your trading sy...
How to Use the Percentage Scale
How to use the new Market Regimes Feature in QuantShare Trading S...









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.