tg-me.com/PineCodersSquawkBox/191
Last Update:
🌲 #newfeature
You can now use placeholders of the form {{strategy.*}}
in the string used with the alert_message
parameter of strategy.*()
functions. This makes realtime information available in alert messages generated from scripts, just as can be done when using the placeholders from the "Create Alert" dialog box's "Message" field:
//@version=5
strategy("My strategy", overlay=true, margin_long=100, margin_short=100)
alertString = '{{strategy.order.action}} {{strategy.position_size}} {{ticker}} \nMarket position was {{strategy.prev_market_position}} and is now {{strategy.market_position}}'
longCondition = ta.crossover(ta.sma(close, 14), ta.sma(close, 28))
if (longCondition)
strategy.entry("My Long Entry Id", strategy.long, alert_message = alertString)
shortCondition = ta.crossunder(ta.sma(close, 14), ta.sma(close, 28))
if (shortCondition)
strategy.entry("My Short Entry Id", strategy.short, alert_message = alertString)
BY PineCoders Squawk Box
Warning: Undefined variable $i in /var/www/tg-me/post.php on line 283
Share with your friend now:
tg-me.com/PineCodersSquawkBox/191