top of page
Writer's pictureCameron

Automated Trading Guide for Daily Edge Strategies

Updated: Oct 23, 2020

The RSI-ATR DIVINE™ Strategy (and soon the RSI-Renko DIVINE™ Strategy) was recently updated to support the Dynamic Alert feature that was introduced in October, 2019. This feature is a long time coming and a complete game changer for a variety of reasons. The dynamic alert feature allows the injection of global variables and plot output variables directly into the alert message for a given study (and someday a strategy). This creates the mechanism to get data out of Trading View and into an exchange for order executions.

 

This guide instructs the subscriber of the strategy how to use the Alertatron bot to automate the trades.

Entry Order Types (To get into trades)

  • Stop-Limit (for swing and target trades)

  • Limit (for scalps)

Exit Order Types (To get out of trades)

  • Stop (for swings)

  • Limit (for targets)

 

Initial Long/Short Building


This trade alert is for the very first long/short after the Major ATR Trend direction changes to positive/negative. It is the trade that will execute the Swing, Target 1, and Target 2 trades (if desired). The long/short swing trade will only execute on this alert.














The initial long in the example above is triggered when after an RSI oversold condition occurs, and then the high of any subsequent candle breaks the high of a the previous candle by at least 1 tick/pip. It is marked by a larger arrow. To enter into a long or short trade apply this alert to the study (The study version of the strategy is for alerts only):














It is important that "once per bar close" is used so that the RSI oversold condition is confirmed by the candle before the order is submitted.


The alert message:


myApiKeys(XBTUSD){

# swing

limit(side=buy, position=20%,

offset=@{{plot("SwingORTarget-Stop-Limit-Order")}});


# target 1

limit(side=buy, position=15%,

offset=@{{plot("SwingORTarget-Stop-Limit-Order")}});


# target 2

limit(side=buy, position=15%,

offset=@{{plot("SwingORTarget-Stop-Limit-Order")}});

}

Notes:

  • It is important to always use "position=XXX" or "position=YYY%" for a long so that if this trade is closing out an existing short position by entering long, the desired position direction and quantity is achieved upon the long executed.

  • The {{plot("SwingORTarget-Stop-Limit-Order")}} is the mechanism to extract the stop-limit value for the long from Trading View. The value is injected into this placeholder when the alert fires. The @ symbol assures that this stop-limit order is executed AT the desired price.

  • Three separate orders are generated for the Swing, Target 1, and Target 2 trades. Depending on the settings of the strategy used for back testing, you may not execute all of these trades. Only include the trade types in the message that mirror the strategy settings used in Trading View.

  • When using the strategy version of the script, these three orders are executed separately, each with its own desired quantity or percent. For example, if the strategy settings were 20% Swing, 15% Target 1, and 15% Target 2.

  • Inline comments using "#" can be used in the message

  • The webhook URL is the special URL for each alertatron account holder.

  • See more here.

 

Pyramid Long/Short Building


This trade alert is for subsequent long/short after the initial long/short. It is the trade that will execute pyramid Target 1 and Target 2 trades (if desired).














The pyramid long in the example above is triggered exactly as the initial long trade. It is marked by a smaller double arrow.


To enter into a long or short trade apply this alert to the study (The study version of the strategy is for alerts only):















It is important that "once per bar close" is used so that the RSI oversold condition is confirmed by the candle before the order is submitted.


The alert message:


myApiKeys(XBTUSD){

# target 1

# check that total position has not reached

# the desired pyramid threshold

continue(if=positionLessThan, value=70%);

limit(side=buy, position=15%,

offset=@{{plot("SwingORTarget-Stop-Limit-Order")}});


# target 2

# check that total position has not reached

# the desired pyramid threshold

continue(if=positionLessThan, value=70%);

limit(side=buy, position=15%,

offset=@{{plot("SwingORTarget-Stop-Limit-Order")}});

}

Notes:

  • It is important to always use "position=XXX" or "position=YYY%" for a long so that if this trade is closing out an existing short position by entering long, the desired position direction and quantity is achieved upon the long executed.

  • The {{plot("SwingORTarget-Stop-Limit-Order")}} is the mechanism to extract the stop-limit value for the long from Trading View. The value is injected into this placeholder when the alert fires. The @ symbol assures that this stop-limit order is executed AT the desired price.

  • Two separate orders are generated for the Target 1 and Target 2 trades. Depending on the settings of the strategy used for back testing, you may not execute all of these trades. Only include the trade types in the message that mirror the strategy settings used in Trading View.

  • When using the strategy version of the script, these three orders are executed separately, each with its own desired quantity or percent. For example, if the strategy settings were 15% Target 1, and 15% Target 2.

  • It is important that the continue (or stop as the converse) instruction is used in the pyramid orders. This provides the mechanism to limit the total number or pyramid orders taken just like the Strategy property settings.

  • The webhook URL is the special URL for each alertatron account holder.

514 views0 comments

Recent Posts

See All

コメント


bottom of page