Click here to Login





                                                   IFF and colors

  0

0
allan nathan
2012-09-20 19:57:05


Hi,
I am a bit lost..Here is my formula which i believe to be correct.Normally I would use the IFF function to chart different colors for RS<>0

Color=iff(rs>0,colorgreen,colorred)'

How do I do it in quantshare??


symbol="spy";
a=getseries(symbol,close);
x=a-ref(a,-21);
x1=x/ref(a,21);
y=close-ref(close,21);
y1=(y/ref(close,21))*100;
rs=y1-x1;




QuantShare
2012-09-20 19:59:43

  0

You should use the "UpdateColor" function. "Iff" function gets numeric vectors only.

http://www.quantshare.com/how-277-how-to-change-volume-bar-colors-when-the-price-closes-down



allan nathan
2012-09-20 21:02:38

  0

thanks,but i cant get it to work

Allan



QuantShare
2012-09-21 00:34:02

  0

As described in the above article, the "UpdateColor" function should be used just after "Plot".



QuantShare
2012-09-21 00:35:11

  0

Example:
Plot(rs, "", colorGreen);
UpdateColor(rs <= 0, colorRed);



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
Drawdown: Long and Short
Optimizable Fibonacci Long and Short Trading System
Large price and volume gain after consolidation
Brent and Crude Oil Continuous Futures Contracts - Intraday Data
Stock News from Articles, Bloggers, Columnists, Traders and Analy...

How-to Lessons
How to change volume bar colors when the price closes down
Difference between the watchlist and the screener tools
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

Related Forum Threads
Does IFF always call embedded functions regardless of true/false?
How to browse and search the blog?
Can one add a vector of price and trade signals and get a backtes...
Quaterly revenue growth and TTM revenue growth
Where can I get global historical stock and bond index prices?

Blog Posts
Limit and Market orders
Lock, Link and Undock your Charts
How to Scan for Parallel Resistance and Support Lines
How To Create and Backtest an S&P 500 Trend Following System
Backtesting a Strategy Based on Bond and Stock Index ETFs









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.