Email Bot

From Haasonline Software Wiki
Jump to: navigation, search

The Email Bot can be used to integrate with TradingView's email alerts. It will fetch emails and compare them with predefined messages. If there is a match it will execute a defined action.

Restriction

None

Best Practice:

  1. Prepare subscription and a main account that you use to login to TradingView.
  2. Create a dedicated email address for the bots.
  3. Add the dedicated email credentials as a provider.
  4. Whitelist the signal provider (for example [email protected]) in the "Approved Contacts" section (optional)
  5. Forward emails from TradingView on your main account to your dedicated account.
  6. Enable less secure apps in your dedicated account.
  7. Setup alerts and bots

Positive Notes

  1. You can combine multiple signals for 1 action. If all the signal are received within X seconds, the action will be executed.
  2. You can run multiple bots on the same signal email.
  3. No limit on the number of signals per bot.
  4. Spot, Margin & Leverage.

Negative Notes

  1. You need to enable "less secure apps" on your account. Hence the "Best Practice" guide.


Performance

Parameters

EmailParameters.png


Minimum Price Change To Buy When the bot has sold, the price needs to drop a determined percentage in order to buy again. When set on 0% this safety is ignored.

Maximum Price Change To Sell After the bot has bought, the price needs to rise to a determined percentage in order to sell again. When set on 0% this safety is ignored.

Stop Loss After the bot has bought, and the price drops a determined percentage, the bot will execute a sell order. When set on 0% this safety is ignored.

Email Actions

EmailActions.png


EditActions.png


Providers HTS support emails from multiple email addresses. With the provider filter you can specify which email address the bot reacts to.

Action Action to perform when an email is a match.

Timeout When using multiple signals, the timeout allows a certain timespan between the emails. If all the messages are received before the timeout, the action is executed.

Message A message can be defined in 3 way:

- Exact match (case insensitive)
- Wildcard. Use an * as a wild card. For example: *Sell_BTC_USDT_1
- Regular expressions. For example: .*Sell_BTC_USDT_1

Tradingview Alert Guide

TradingView has a great collection of alerts users can utilize. Ranging from simple price alerts to indicator crosses. This guide will show you how to create a price alert and a indicator alert for the bot to act on.

Price alerts

  1. Go to www.tradingview.com and select the market you wish to trade on (Bitstamp BTC/USD for example)..
  2. Click on alert in the header. A new popup will show with the configuration settings.
  3. In the Condition section, change “Crossing” to “Crossing up” and change the value to the price on which the alert should fire. $10.000 for example.
  4. Make sure “Send Email” is enabled.
  5. Change the message to something unique. BOT_1_BUY_BTC for example and hit save. When the price break 10.000 USD, Tradingview will send you a email with this a subject: TradingView Alert: BOT_1_BUY_BTC
  6. Go to the Email bot in HTS and add an action. Select the action you want to perform once the price reached 10.000 USD (buy for example). In the message section add the subject defined in 5.
  7. Save the action and start the bot.

The bot will wait for an email to be received where the subject matched the one we have defined. Once that email is received the bot will place a buy order at the current price.

Indicator alerts

  1. Go to www.tradingview.com and select the market you wish to trade on (Bitstamp BTC/USD for example).
  2. Click on “Indicator” in the header and add an indicator (MA for example). Modify the indicator settings if needed.
  3. Click on alert in the header. A new popup will show with the configuration settings.
  4. In the Condition section, change “Crossing” to “Crossing up” and select the indicator in the “Value” dropdown.
  5. Make sure “Send Email” is enabled.
  6. Change the message to something unique. BOT_1_MA_UP_BTC for example and hit save. When the MA crossed over, Tradingview will send you an email with this a subject: TradingView Alert: BOT_1_MA_UP_BTC
  7. Add a second alert, but change “Crossing” to “Crossing down”. Make sure the message is unique again. BOT_1_MA_DOWN_BTC for example.
  8. Go to the Email bot in HTS and add an action. Select the action you want to perform once the MA has crossed over (buy for example). In the message section, add the subject defined in 5.
  9. Save the action and add a second action to sell once the MA has crossed down.
  10. Start the bot.

The bot will wait for an email to be received where the subject matched the one we have defined. Once that email is received the bot will place a buy or sell order at the current price depending on the coin position of the bot and the email received.