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 ;
setstoploss(stoploss);
setprofittarget(profittarget);
if condition1 then alert("Long Position Opened");
if condition2 then alert("short position Opened");
end;
Question Two, How can i get a alert message tells me my stoploss or profittarget if they have been triggered?
Thanks a lot!