Can anybody give me a hand on the alert coding please. Struggling for a while now.
The idea is I want to get email alert when my signal open/close a position and if position hit stoploss and profittarget, it will also give me alert.
my code is below,
Code: Select all
if condition1 then
buy ( "Buyme" ) next bar at market ;
if condition2 then
sellshort ("Sellme") next bar at market ;
if condition1 then alert("Long Position Opened");
if condition2 then alert("short position Opened");
my question one is: how can I get alert message showing me position opened and the shares size has been opened/closed? I tried alert("Long Position Opened" + Shares); however, shares didn't work.
Question Two, How can i get a alert message tells me my stoploss or profittarget if they have been triggered?
Thanks a lot!