Real Money vs Sims: What I Learned about Zenbot

Sims are a very optimistic view of a trade strategy. The first serious problem I encountered was that my bot didn’t reliably buy with real money. I made my strategy keep track of when my bot wants to buy and sell through files, and I simply watched the attempted trades pile up as files. I used Autohotkey to keep track of the files and follow through with the orders by issuing manual trade commands on behalf of zenbot. I also realized it’s a terrible time to sell when the crypto peaks. Which is why my bot now sells before peak; pigs get slaughtered. I noticed no difference in the sims, but it did fix my leak with real money.

Zenbot sim and Brute Force

@echo off
set _endPct=10
set _crypto=OXT-USD
set _strategy=dip
set _dipPct=3
ECHO Simulating dip 3 to 10 percent for %_crypto%
set _zen_cmd=zenbot sim –strategy=%_strategy% gdax.%_crypto% –dip_pct=%_dipPct%
FOR /f “tokens=2 delims=^()^” %%H IN (‘%_zen_cmd% ^|find “end balance”‘) DO set _roi=%%H
ECHO Spread: %_dipPct% percent  ROI: %_roi%
set /A _dipPct=%_dipPct%+1
IF %_dipPct% LEQ %_endPct% goto loop

I made this batch script to execute zenbot sim with 3 parameters. You can see how I placed those values into the string that will be the zenbot command. FOR is a bit of black magic; it sets the _roi variable using the output from the sim command where it finds “end balance”. It loops while incrementing _dipPct variable that gets used in each zenbot sim execution until it reaches _endPct.

Now I shifted this loop to be done in Autohotkey, and I only use the batch script to execute zenbot commands and close itself, (which AHK has trouble with for some odd reason).