ex=bybitv5demo acc=*
# query PnL of all closed trades from the last 24h (1d) and save the summarized data to local variables
query=pnl from=-1d sym=* save
echo="We made {lastpnlsum.2}% in the last 24h!" 
if=(lastpnlsum < 0) goto=loss
exit
 
:loss
echo="WE HAD LOSSES, STOP THE MACHINES!":fatal 
disable=PV
 
# alternatively: disable entry alert and enable again if lastpnlsum >= 0 (disable=alertname)
# alternatively: place a custom lock with an expiration time to prohibit entry temporarily
# alternatively: set a global variable that you check in the entry alert

Note: Currently only works on Bybit, but the query command will soon be implemented for other exchanges as well!


To run the above check automatically in regular intervals you can simply configure the PV alert accordingly:

Note: You might have to click the little syphon icon on the right above all the alerts to toggle the visibility of the advanced filtering options!

Attention

Always double check that you are using the right syntax/alert!