This is an old revision of the document!


Example for LIMIT Entry Loop with Market Fallback

# update balance, cache/save current price 
updatebalance updateprice
# only use cached balance from here on to have quantity % resolve consistently 
cachedbalance
 
:limitLoop
# place limit order using leftover quantity from last cancel=order in this alert or the specified quantity as fallback (used for first run!) 
# accept a maximum of 0.5% price slippage against us (compared to cached price from start of alert), otherwise jump to "badPrice"... 
side=[side] leftover quantity=YOUR_QUANTITY% leverage=YOUR_LEVERAGE price=[-]0.25 maxslip=0.5% ifslip=badPrice type=post id=entry maxtime=60 iftime=tooLong
delay=10
cancel=order id=entry ifnone=main save # if all filled we are done => go to "main", otherwise save leftover quantity for next run 
do=limitLoop jd=0
 
:badPrice  # price went too much against us, check if we have partial position and continue with "main", otherwise exit! 
check=pos side=[side] iffound=main
exit
 
:tooLong  # limitLoop took to long to get an entry, open leftover quantity (or all, if no partial fill occured before) with market order 
side=[side] leftover quantity=YOUR_QUANTITY% leverage=YOUR_LEVERAGE type=market
# for safety give market order a few sec till its fully there 
delay=3
 
:main
### place SL and TP here ### 

Quantity, leverage, stoploss and takeprofit have to be adjusted to your strategy / personal needs!

Attention

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