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).

Leave a Reply