Click here to Login





                                                   Lower of formula

  0

0
JC
2018-11-17 13:47:33


Is there a formula such as the "lower of" two values?
for example I'd like to plot the lower of two indicators when using an exit. such as the lower of an SMA and the SAR for example

using pseudo code
close<"lowerof" sma(10), sar(o.2,0.2);

I'm sure it could be written as an IF statement. but it would be so much easier if there was



QuantShare
2018-11-19 04:09:09

  0

Best Answer
Hi,

You can type something like:
a = min(sma(10), sar(0.2, 0.2));

For the IF Statement, you can type:
a = iff(condition, series1, series2);



Christian
2018-11-19 07:42:59

  0

I have a similar problem, but with different series data.
With that formula I tried to get the lowest value from that three series, but the MIN function is not accepting that code:

v1 = GetSeries('C_1', close);
v2 = GetSeries('C_2', close);
v3 = GetSeries('C_3', close);
vMin = min(v1, v2, v3);



JC
2018-11-19 15:53:43

  0

certainly works for my predicament, thanks for responding so quickly absolutely amazing


QuantShare
2018-11-20 04:06:46

  0

Use this:
vMin = min(v1, min(v2, v3));



Christian
2018-11-21 06:08:36

  0

Okay, thank you.


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
Black-Scholes Option Pricing Model formula
Trading based on Boillinger Lower Band position on defined Market
PREV - Previous value of the same formula
PIPS conversion formula in Forex trading
Sharpe Ratio Ranking System to Lower Trading Strategies Volatilit...

How-to Lessons
How to create a formula
How to speed up watchlist and screener plug-ins when working with...
How to change volume bar colors when the price closes down
How to drag & drop indicators in charts
How to display notes/commentaries on a chart

Related Forum Threads
bollinger band & rsi formula
BSignalLong Formula
Screen formula
Regarding Formula
Formula Creatin

Blog Posts
Working with the formula editor
Charting, Backtesting and Trading using Fundamental Data
Backtesting a Strategy Based on Bond and Stock Index ETFs
Fundamental Stock Analysis: Rank stocks based on a valuation rati...
Different Types of Trading Indicators: Trend, Momentum, Volatilit...









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.