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
US Crude Oil Supply, Consumption, and Inventories
5-Minute Historical Intraday Data for Forex, Indices and Futures/...
EOD Quotes Data for Hong Kong Stocks and ETFs
PEG and Price to Free Cash Flow above Market Averages
BSE Main and Sectoral Indices

How-to Lessons
How to change volume bar colors when the price closes down
Difference between the watchlist and the screener tools
How to create trading rules based on Put and Call volume data
How to create and trade a Neural Network model
How to scale and move the chart Y-axis

Related Forum Threads
Does IFF always call embedded functions regardless of true/false?
DISCREPANCIES IN SCREENING BY SCREENER AND SCREENING THRU WATCHLI...
Can I update the sector and industry information in the stock dat...
Valuation, fundamental and dividends
Previous day high and low in in intraday chart

Blog Posts
Watch your support and resistance lines
How to Calculate and Display the Bid/Ask Spread on a Chart
Backtesting chart patterns using the auto support and resistance ...
6 ways to download free intraday and tick data for the U.S. stock...
Fundamental Screen based on Stock price, ROI and Market capitaliz...









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 © 2025 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.