Add alerts to a Recursive indicator?

Monopod

New member
VIP
I am wondering if it is possible to create alerts for the HACOLT indicator which is one fo the studies included with TOS. I believe this one is recursive. I would need the alert to function on a tick chart. This indicator does not repaint and does not kick out a large number of signals, but it does go around the clock. Any thoughts?
 

mc01439

Well-known member
2019 Donor
VIP
@Monopod - https://tos.mx/fqc241A

Added Vertical Lines for the test, remove if you wish. Has been tested on a tick and time chart.

y5RU8Fc.png
 

Monopod

New member
VIP
MC- I have used that for a week now and find that it works very well. Thank you for taking the time. I really appreciate it.

At the risk of taking advantage of the kindness of strangers, I also need an alert for the Hull Moving Average (HMA) indicator for the color change of the plot line. I use the 20 period on a tick chart. I need the sound only and preferably a different alert tone than the one used on the HACOLT above.
 

mc01439

Well-known member
2019 Donor
VIP
MC- I have used that for a week now and find that it works very well. Thank you for taking the time. I really appreciate it.

At the risk of taking advantage of the kindness of strangers, I also need an alert for the Hull Moving Average (HMA) indicator for the color change of the plot line. I use the 20 period on a tick chart. I need the sound only and preferably a different alert tone than the one used on the HACOLT above.
This should work - https://tos.mx/ybVtMbX

This has a delay to help identify possible whip-saws. The alert sound can be changed under edit studies.
 
Last edited:

RmS59

Member
I hope someone can help me with Recursive variables.


I want to capture if the last signal was a buy or if it was a sell.

How do I retain the status? When I try this, nothing plots.

def signalstate = if buysignal then 1 else if sellsignal then -1 else signalstate[1];
# buysignal and sellsignal only have a value when the signal occurs, and is equal to Double.NaN the rest of the time

plot Trend = signalstate;


Can someone educate me on what I am doing wrong?

thanks
 

tomsk

Well-known member
VIP
Assuming you already have definitions for buy and sell signals already established, here is how you retain the state whether the last signal was a buy or sell.

Code:
def signalstate;

if buysignal {
    signalstate = 1;
} else if sellsignal {
    signalstate = -1;
} else {
    signalstate = signalstate[1];
}

AddLabel(1, "State = " + if signalstate == 1 then "Buy" else if signalstate == -1 then "Sell" else " ", Color.White);
 

RmS59

Member
I take that back!! Sorry.

I was assuming the wrong data type of my signals.

When I changed it to:

if !IsNaN(buysignal) {
signalstate = 200;
} else if !IsNaN(sellsignal) {
signalstate = -200;
} else {
signalstate = signalstate[1];
}

It worked fine.

Thanks for your help
 

jmoney

New member
I recently found a great study/strategy, and I would love to semi-automate it using alerts or conditional orders, but it has a recursive function involved, compoundValue. Anyone have any idea how to get around that issue?
thanks,
J
 

gerar85

New member
Hi @mc01439 I find myself in the same situation as Monopod... Id like to receive an alert everytime the MovAvgAdaptive "AMA" crosses the MovAvgAdaptive"KAMA" on a specific set of stocks, as they are recursive I can't create it in the alert wizard. Can you help me out? Thank you in advance!
 
Last edited by a moderator:

mc01439

Well-known member
2019 Donor
VIP
Hi @mc01439 I find myself in the same situation as Monopod... Id like to receive an alert everytime the MovAvgAdaptive "AMA" crosses the MovAvgAdaptive"KAMA" on a specific set of stocks, as they are recursive I can't create it in the alert wizard. Can you help me out? Thank you in advance!

Here is a AMA KAMA code with an alert in it you my be able to use?

https://tos.mx/fKUab8M

Code:
#Alert
def alerttrigger1 = MovAvgAdaptive1 crosses MovAvgAdaptive2;

input alerttext = "!!!!! AMA  crosses KAMA  !!!!!";

input UseAlerts = {false, default true};

input AlertType = {default "BAR", "ONCE", "TICK"};

def at = AlertType;

input AlertSound = {"Chimes", "Ring", default "Bell", "NoSound", "Ding"};

Alert (alerttrigger1 and UseAlerts, alerttext, if at == 1 then Alert.ONCE else if at == 2 then Alert.TICK else Alert.BAR, AlertSound);


Sorry - will need to see the code you are using for "AMA" and "KAMA" to be more specific.
 

balbek

New member
Hi everyone, I was attempting to make a strategy and also a conditional order that reference my 3 indicator system. 2 studies are built in to TOS and have no problem, but when i reference the RSI Lageurre time study i get an error in the strategy builder that says its probably too complicated to work and in the condition wizard that the study wont work because it contains recursion.
Anyway, my question is there a work around or a version of the mobius RSIL that will work for either conditional orders or Strategy?
Thanks anyone.
 
Last edited by a moderator:

Similar threads

The Market Trading Game Changer

Join 2,500+ subscribers inside the useThinkScript VIP Membership Club
  • Exclusive indicators
  • Proven strategies & setups
  • Private Discord community
  • ‘Buy The Dip’ signal alerts
  • Exclusive members-only content
  • Add-ons and resources
  • 1 full year of unlimited support

Frequently Asked Questions

What is useThinkScript?

useThinkScript is the #1 community of stock market investors using indicators and other tools to power their trading strategies. Traders of all skill levels use our forums to learn about scripting and indicators, help each other, and discover new ways to gain an edge in the markets.

How do I get started?

We get it. Our forum can be intimidating, if not overwhelming. With thousands of topics, tens of thousands of posts, our community has created an incredibly deep knowledge base for stock traders. No one can ever exhaust every resource provided on our site.

If you are new, or just looking for guidance, here are some helpful links to get you started.

What are the benefits of VIP Membership?
VIP members get exclusive access to these proven and tested premium indicators: Buy the Dip, Advanced Market Moves 2.0, Take Profit, and Volatility Trading Range. In addition, VIP members get access to over 50 VIP-only custom indicators, add-ons, and strategies, private VIP-only forums, private Discord channel to discuss trades and strategies in real-time, customer support, trade alerts, and much more. Learn all about VIP membership here.
How can I access the premium indicators?
To access the premium indicators, which are plug and play ready, sign up for VIP membership here.
Top