0

I have back-tested my trading strategy using pandas data-frames and found the win-rate, sharpe ratio etc.

import pandas as pd
import talib
import numpy as np   
import matplotlib.pyplot as plt
import mplfinance as mpf
import xx

in_csv="AXSUSDT-1m-2021-06.csv"
out_csv="OUT.csv"

ema_period=200;  xx.RR=1.5
column_heads=["Date", "Open", "High","Low", "Close","Vol"]

df = pd.read_csv(in_csv, usecols=[0,1,2,3,4,5],names=column_heads, header=None)
df["Date"]=(pd.to_datetime(df["Date"],unit='ms'))
df["M"],df["S"],df["H"] = talib.MACD(df["Close" ], fastperiod=12, slowperiod=26, signalperiod=9)

#df["M"]=m;df["S"]=s;df["H"]=h
#EMA
ema = talib.EMA(df["Close"], timeperiod=ema_period)
df["EMA"]=ema

#STACK OVERFLOW  
df = df = xx.green(df);xx.red(df);df = xx.histo2(df);df = xx.histo1(df);df = xx.short_dive(df);df = xx.long_dive(df);df = xx.jump_dive(df);df = xx.h2(df);df = xx.h1(df);df = xx.l2(df);df = xx.l1(df);df = xx.mh2(df);df = xx.mh1(df);df = xx.ml2(df);df = xx.ml1(df);df = xx.ch2(df);df = xx.ch1(df);df = xx.cl2(df);df = xx.cl1(df);df = xx.position(df);df=xx.exits(df);df=xx.cerebro(df)

df.to_csv(out_csv)

The result of the above code gives a back-tested data-frame with entry,loss or profit. output_image

The issue is how to pull this off in the live market. I don't know how to go about implementing this to a live feed data.

I need to calculate the entry price, stop-loss, take-profit and volume and before placing an order.

I actually set up Trading-view alert which returns the stop-loss, takep-rofit,volume to trade...to my Gmail inbox..

Is there a way to scrape the data from my Gmail feed and execute the trade with the scraped parameters.

Or should I code something to receive data from and calculate the trade trigger from my end.

Skuller
  • 23
  • 4

1 Answers1

0

I am implementing something similar, to do so I rely on pyalgotrade, which has also a wrapper for TA-Lib. This library provide a broker section which allows you to plan and execute trades using API of your favorite store, beside this there is a strategy section which allows you to develop and backtest your strats

Mirco
  • 165
  • 2
  • 13