Click here to Login

                                                   Trend Regime as a function


2021-04-08 17:14:39

Hi, I'm looking for a function that is very similar to the "ExRem" in amibroker
the exrem works as follows:
ExRem (array1,array2);

the array, and could be your entry criteria, b another array or could be your exit criteria
its usefulness is that it remains as 1, when your first array is met, and then 0 when your second array is met
This is particularly useful in setting a trend regime

My "trend" is when the upper donchian is broken, and then remains as an uptrend until the lower donchian is broken
im struggling to make this a condition, such that this is my trend and i can assign an array to this
My buy signal is completely separate, but is conditional on my trend being true

hope this makes sense

if this were amibroker code
a = close>HHV(10);
b = close<LLV(10);
bullish = exrem(a,b); and would be 1 where a is met, and zero when b becomes met

my buy signal then could be
buy = cross(smaX,smaY) AND Bullish allowing me to have a buy signal but on condition of my overall trend being met

2021-04-23 14:10:04


Best Answer
Try using the "RemoveSameSignals" function.

2021-04-24 17:06:46


Perfect, exactly what i was looking for. 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
LSS Pivotal Buy and Sell Numbers - Trend Reaction
Volume Trend Index - Market Indicator
Volume Accumulation Trend Line
Trend Deviation Indicator
Trading Rules using Trend Indicators

How-to Lessons
How to dynamically change the number of positions in a portfolio?
How to plot arrows below/above candlesticks on a chart
How to set order type of a trading system programmatically
How to display the bar index of a stock on a chart
How to hide a trading indicator from a particular time frame

Related Forum Threads
Calling a Function from another Function
trend line stick to high and low
moving trend line
Count() with STDdev function anomoly
Comp Function

Blog Posts
Trend Following and Moving Averages
Trend following systems
How to Pick the Best Trend Indicators
How to create market indicators using the composite function - Pa...
How to create market indicators using the composite function - Pa...

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

Copyright 2021
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.