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
Price and Volume Trend
Potential Issues and Errors in Historical Data
Bulls and Bears Strategy
Large price and volume gain after consolidation
Support and resistance lines based on N-Minutes high/low of a tra...

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?
Money Management Script variables and more
drawing objects in log mode in daily and weekly charts
Indicies and Sectors
VIX Indicator and Put/Call Ratio Indicator for NSE NIFTY

Blog Posts
How to create and backtest thousands of trading rules in less tha...
How to create a trading system, screen and composite using earnin...
Inverse Fisher Transform: Indicator, composite and trading system
Trading System Analysis: Backtesting report and custom measures
6 ways to download free intraday and tick data for the U.S. stock...









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.