Author Archives: Bryan D

Crypto trading bot on order book with 66% win ratio video playback

Crypto coin call for Oct 20
Some coins to take note with
Symbol Pct Close First Trend Last Trend Diff
0 LINKUSDT -0.027738 10.85860 9.533217 10.565537 1.032321
1 BTCUSDT -0.099450 12691.10000 10428.999613 11543.132458 1114.132845
2 XRPUSDT -0.011674 0.25147 0.240275 0.248568 0.008293
3 WAVESUSDT -0.119135 3.08440 2.267114 2.756056 0.488943
4 ETHUSDT -0.057609 391.39000 353.803343 370.070728 16.267385
5 LTCUSDT -0.078789 52.46000 45.514420 48.628603 3.114183
6 XLMUSDT -0.085205 0.08482 0.072490 0.078160 0.005671
7 BCHUSDT -0.037295 257.83000 215.322501 248.559951 33.237450

Crypto calls for Oct 20
Here is the updated coins that my script picked up based on trend
Symbol Pct Close First Trend Last Trend Diff
0 ETHUSDT -0.007314 370.24 355.343085 367.551891 12.208806
1 BTCUSDT -0.051430 11968.88 10500.452585 11383.428343 882.975758

Demo of save trade history and calculating daily PnL with Python script
Here is a code review and demo how this Python script can help with daily PNL. Also, this appears to be a bug which should be fixed in Motivewave soon.
Here is the code:
import pandas as pd
import glob
fn = glob.glob('C:\\Users\\Bryan\\Dropbox\\Apps\\Blighty Explorer\\TradeHistory *.csv')
df = pd.read_csv(fn[-1])
print('opening '+str(fn[-1]))
## round to 8 decimal places in python pandas
pd.options.display.float_format = '{:.8f}'.format
cols =['Account','Ticket','Order ID','Symbol','Time','Action','Quantity','Price','P/L','Commission']
df['P/L'] = df['P/L'].fillna(0.0)
df['Price'] = pd.to_numeric(df['Price'],errors='coerce')
df['P/L'] = pd.to_numeric(df['P/L'],errors='coerce')
df['PctRet'] = df['P/L'].values/df['Price'].values
df['Date'] = pd.to_datetime(df['Time']).dt.date
df['Time'] = pd.to_datetime(df['Time']).dt.time
df['PctRet'] = pd.to_numeric(df['PctRet'],errors='coerce')
arrByDay = df.groupby('Date')['PctRet'].sum()
dfCond=df.groupby('Date')['PctRet'].apply(lambda x: (x>0.0).sum()).reset_index(name='count')
totArr = df.groupby('Date')['PctRet'].count()
dfCond['total'] = totArr.values
dfCond['percentChg'] = arrByDay.values
dfCond['winRatio'] = dfCond['count']/dfCond['total']
print(dfCond)

Ensure proper MotiveWave crypto order preset for minimum quantity size
I show the scenario how to fix any blank/empty P/L from positions and trade history. I cover this solution in this video
I also have a Python source code script for a way to show you the minimum account size needed for each USDT (Tether) order. I would recommend doing this for new strategies/studies/alerts you want to test for trading. You don’t want to take big orders losses during the debugging phase.
Here is some demo examples how to resolve this blanks P/L problem. This may get fixed in a future version of MotiveWave
import pandas as pd
import os
from csv import reader
try:
os.remove("minQty.csv")
except:
print('minQty.csv does not exist')
with open('usdt.txt') as f: #usdtcoins2.txt usdtallcoins.txt
datafile = f.readlines()
for line in datafile:
sym = line.rstrip()
if sym.find('UP')>0 or sym.find('DOWN')>0 or sym.find('BEAR')>0 or sym.find('BULL')>0:
continue
symb = sym.replace('/','')
os.system('python3 ccxt_market_data2.py -e binance -s '+sym+' -t 1m')
fn = 'data/binance-'+symb+'-1m.csv'
df = pd.read_csv(fn, names=['Timestamp', 'Open', 'High', 'Low', 'Close', 'Volume'])
row = df.tail(1)
cl = float(row['Close'].values[0])
amt = 10.0/cl
amt2 = amt+(amt*0.2)
myCsvRow = symb+','+str(cl)+','+str(amt)+','+str(amt2)
with open('minQty.csv','a+') as fd:
fd.write(myCsvRow+'\n')

Is this coin the next big mover for today?
Here it is
BCHUSDT pct -0.10315589686542881 clLast 255.75 firstTrend 222.26853833305012 lastTrend 231.8348664288546

Crypto assessment for today Oct 13
Here is the one coin but it looks like it is already over its trendline
BNTUSDT pct -0.22144468543193066 clLast 1.3017 firstTrend 0.9940376184814044 lastTrend 1.0657052386614538

New cryptocurrency analysis Oct 12
This is a surprise coin to see
ZECUSDT pct -0.18498967857598675 clLast 74.48 firstTrend 57.761036634392305 lastTrend 62.85286812751257
MKRUSDT pct -0.053226473101709734 clLast 588.31 firstTrend 478.75891860597034 lastTrend 558.5788194892696

Crypto trading analysis Oct 11
Here is the dependable signals ready to move
STORJUSDT pct -0.26451105994759966 clLast 0.5921 firstTrend 0.4385848236226709 lastTrend 0.468244223996377