Click here to Login

                                                   SEARCHFOR THEN WITHIN

Back to threads - Tags: --

2013-10-18 19:03:04

I was using the SEARCHFOR function for particular logic but constantly getting 0 on all bars. To verify, i have just tried plotting your example itself as follows:

a = (SEARCHFOR rsi(14) > 70 THEN rsi(14) < 30 within 10);

This also results in 0 on all bars though there are bars where this condition is satisfied.

Something not working well with this function or my mistake somewhere?

2013-10-18 22:48:50


"SearchFor" function is a bit complicated to use, we are currently working on updating it.

You can get the same logic using QS language:
a = rsi(14) < 30 and barssince(rsi(14) > 70) < 100;

2013-10-19 08:46:42


Thanks for clarifying and also for the alternate formula. Actually, it will be great if the SEARCHFOR function is usable properly. With a few simple words, the amount of possibilities which can be accomplished by this function is amazing. Especially for non-programmers like me.

2014-06-12 13:59:57


Any update on this?

2014-06-12 14:53:01


Best Answer
We haven't started yet working on the update. Hope soon.

John Lyons
2015-08-18 04:52:45


Any update?

2015-08-19 03:46:06


Sorry, not yet.

No more messages


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"


Trading Items
Time-series location relative to its high and low
Volume Accumulation Trend Line
Market Index for the Gold and Silver Industry
Trading Strategy based on the Number of Buy Signals
State Change Pattern in a Trading Rule

How-to Lessons
How to automate the data downloading process
How to quickly download the most recent EOD data for your stocks
How to install the previous version of QuantShare
How to import your own list of stocks/symbols
How to optimize the number of positions in a trading system

Related Forum Threads
Dynamic searchfor
Password to lock the formula within screener.
Looping within a screener and how to use RemoveSameSignals
Incorrect position metrics using MMExitPosition within MM script
Function/property to catch the first visible bar/date within a ch...

Blog Posts
How to combine long, short and custom portfolio strategies within...
Example of advanced rule
How to Reference Drawing Studies in QS Formulas
How to Download Trading Data for Certain Securities Only
4 indicators to create adaptive trading systems

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2024
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.