Click here to Login

                                                   Lower of formula


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

2018-11-19 04:09:09


Best Answer

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);

2018-11-19 07:42:59


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);

2018-11-19 15:53:43


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

2018-11-20 04:06:46


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

2018-11-21 06:08:36


Okay, thank you.

No more messages


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"


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 create a screen
How to download and use U.S. stocks earnings data
How to create a moving average of an indicator

Related Forum Threads
bollinger band & rsi formula
BSignalLong Formula
formula use all over
Error in formula
Guru, formula for line cross

Blog Posts
Working with the formula editor
Detect chart patterns using the auto support/resistance indicator
Trading Forex with the commitments of traders report
Create indicators, composites and trading systems using QL and CS...
4 original breadth indicators you should consider in your market ...

Create an account
Affiliate Program
Contact Us
Trading Forum
How-to Lessons
About Us
Terms of Use

Copyright 2019
Social Media
Follow us on Facebook
Twitter Follow us on Twitter
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.