Macro to trigger on tradingview alert

Does anyone know how i can trigger a macro from a tradingview alert? it can be an email, webhook , in app alert. I don't see any options for the TV app in KM except for when the app launches, quits.

Keyboard Maestro doesn't typically have app-level built-in actions, excluding a few things like Chrome, QuickTime Player, and Safari. You'll have to build your macro based on datecting the alerts.

If I'm reading correctly, you can receive alerts via a web hook, an email, or an in-app alert? You can probably get KM to react based on any of those things:

  • Email: See this topic for an example of how to set a KM variable and launch a macro via a rule in Mail.
  • Web hook: This is not my area of expertise, but I expect we'd have to know a bit more about what exactly this looks like.
  • In-app alert: You could use KM's Found Image action to watch for the alerts.

To trigger the macro, you could use Clipboard Changed (runs often and would need some good 'case' statements at the beginning to quit if the clipboard content wasn't relevant), Folder (watch for changes in a folder), or Periodic (check something on a timed basis). Which trigger to use depends on how the data you want to see is getting stored.

Personally, the email-to-Keyboard Maestro method seems like a good solution, as Mail would do the "periodic" portion of the work: It watches your email, sees an alert, sets whatever variables you need to use, and then launches your macro.

My advice above is somewhat vague, as I have never used TradingView, and have no idea what the alerts actually look like.


I think it would be helpful if he clarifies whether he wants KM to run silently in the background, allowing him to use his Mac while the monitoring occurs, or whether he's okay with the idea that the Mac's GUI is being used by KM to do the detection, so simultaneous usage by a person might be difficult in that case.

There are hybrid approaches which might work. For example, the KM macro might stop monitoring until the Mail app is at the front, for example. When the Mail app is visible at front, it could perform an OCR of the mail app every 30 seconds to see if a new message has arrived. (And I think a Smart Mailbox rule in the Mail app could be helpful here.)

I've never compared the CPU usage for Find Image compared to OCR Screen, but as time goes on I become more favourably disposed towards using OCR to monitor for things.

I'd probably handle this by letting the Mail rule just run, but having the triggered macro present a "press any key to act on the alert, or just wait to do nothing" box. That way, you're not taking up any more cycles to monitor Mail, and if they want to handle an alert they can by interacting with the box, or just wait a second (or whatever) and then nothing happens.

But definitely something for the user to decide :).


Thanks for the replies guys, i could do it either way, i want it to work while im sleeping with no user input. so i wont be using the computer at this this time. I will investigate the email thing and see if i can figure it out.