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
Advancing-Declining-Unchanged volume for NYSE, AMEX and NASDAQ
Advanced Quotes and Custom Databases Function
Detect and Display Potential Splits on a Chart
Short Term Volume and Price Oscillator
Entry Price and Exit Price in Trading System Report

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?
Quantshare release notes and in the works
GURU, GOLD AND SILVER
Create and Export each database for each market
VIX Futures and IB problem

Blog Posts
Watch your support and resistance lines
Forecast volatility using trading rules and neural networks
Trading System: Moving average crossover and few others buy and s...
Fundamental Screen based on Stock price, ROI and Market capitaliz...
Create indicators, composites and trading systems using QL and CS...









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.