Send Notification on TP or SL

You can use the following syntax in a separate alert that is set to run in intervals!
See below for a screenshot on how to set up the alert in ProfitView – adjust interval frequency to taste, be aware of API throttling/ban if running too frequently!

e=BITMEX s=XBTUSD    ### remove this line if you are using separate alerts and the run= command (see end of this page) 
ifpos=abort iferror=abort ifnone=continue retries=0
### change expect=2 into expect=1 if you are only using one SL stop instead of 2 (OCC default: limit + market fallback) 
check id=*SL retries=0 save expect=2 noorder=done iffound=hadBing
check id=*TP retries=0 save iferror=abort
 
:hadBong
updatebalance notify=discord:":red_circle: __**{lastid.1} BONG!**__ :red_circle:\n`Balance: \z` **{balance}**\n",log:"*** {lastid.1} BONG! ***":-error
#lock=-1440  ### uncomment this to lock symbol for 24hrs after bong 
goto=done
 
:hadBing
updatebalance notify=discord:":green_circle:  __**{lastid.1} BING!**__  :green_circle:\n`Balance: \z` **{balance}**\n",log:"*** {lastid.1} BING! ***":-success
goto=done
 
:done
cancel
disable=[caller]




Note: Don't forget to switch the log option to “Errors Only” after testing to not flood your log unnecessarily!

Using the new "run" command


Alternatively the checking logic from above can be saved to a separate PV alert that is then referenced only from the interval alerts (for each symbol/account) as pictured below.
This also makes use of the new format to specify all three – exchange, symbol and account – in the account parameter (separated by colon).



The checking alert (set to run in intervals) is then set to disabled and in the alert that does the main entry you use the following syntax at the end to enable the btcperp-check interval alert pictured above:

enable=btcperp-check