Click here to Login





                                                   Looping within a screener and how to use RemoveSameSignals

  0

0
GS
2012-11-05 16:37:00


Hi,

How do I do the following within a screener:

aa = (5,10,1);

b1 = cross(ema(close,aa), ema(close,(aa+5));

buy = b1 (aa = 1) or b1(aa = 2) ......... or b1(aa = 10)


Basically I am looking for a simple loop within which I can check if the above condition is satisfied. As of now I can write 10 times, however I would prefer a compact statement.

Also, I would appreciate if you could explain how to use RemoveSameSignals( ARRAY array, ARRAY array). I want to use it to remove similar multiple signals.

Thanks



QuantShare
2012-11-06 11:42:44

  0

To create a compact statement you would have to implement a custom script using C#

RemoveSameSignals: Returns 1 on the first occurence of 'true' signal in the first array.
then Returns 0 until the array become 'false' then 'true'.

"true" means 1 and "false" means 0.



GS
2012-11-06 12:18:44

  0

RemoveSameSignals: Returns 1 on the first occurence of 'true' signal in the first array.
then Returns 0 until the array become 'false' then 'true'.

"true" means 1 and "false" means 0.

Still it is not clear, would appreciate if you could give a live example which I can plot and see the difference between with and without this function.



QuantShare
2012-11-06 18:13:40

  0

a = rsi(14) > 70;
plot(a, "");

b = RemoveSameSignals(a);
plot(b, "", colorBlue);



GS
2012-11-08 05:57:15

  0

OK, I did the following:

buy = buy_rule;
sell = sell_rule;

buy = RemoveSameSignals(buy,sell);
sell = RemoveSameSignals(sell,buy);

with this I was able to remove multiple buy, sell signals. Looks like this might be a good function for the day trading, however, on EoD chart it would pull you out of the trade much earlier. Do let me know if my observation is correct.

Thanks



QuantShare
2012-11-08 08:38:44

  0

Yes. You can always use the "plot" function to see the impact of a function visually.


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 Put Screener
Time-series location relative to its high and low
Market Index for the Gold and Silver Industry
Chart Patterns: Double Top and Double Bottom
Historical Earnings Surprise, EPS and Consensus Data

How-to Lessons
How to download and use U.S. stocks earnings data
How to speed up watchlist and screener plug-ins when working with...
How to create and trade a Neural Network model
How to download EOD quotes for active and valid stocks only
How to use the Fibonacci retracement drawing tool

Related Forum Threads
use of screener for applied rules
DISCREPANCIES IN SCREENING BY SCREENER AND SCREENING THRU WATCHLI...
Use Screener to Find Potential Splits?
How do I setup Sectors and Industries since Yahoo no longer works...
Variables and their use when creating indicators?

Blog Posts
How to combine long, short and custom portfolio strategies within...
How to use QuantShare screener to trade penny stocks
How to Download and Use Fundamental Data
How to use QuantShare Indicators in the Grid Tool
How to create a trading system, screen and composite using earnin...









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.