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
NYSE, AMEX and NASDAQ 52-week high and low data
Consolidation Breakout and Congestion Index
IPO Pricings - Recent and Historical
Bollinger Bands and Fibonacci Ratios
Margins and Turnover

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?
Basic features and some issues with the background
simulator and optimization
Use mass rule generator and mask to generate rule combinations
ATR stop and MM

Blog Posts
How to Download and Use Fundamental Data
How To Create and Backtest an S&P 500 Trend Following System
Real Time Alerts: Support and Resistance Lines Breakout
Download historical EOD data for the stock, futures, ETF and Fore...
How to predict and trade the stock market using pivot points









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.