Skip to content

Commit 1f16277

Browse files
committed
Last Changes for Release 1.0.0
1 parent ce7d5b8 commit 1f16277

File tree

7 files changed

+14
-17011
lines changed

7 files changed

+14
-17011
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ src/__pycache__/*
22
src/BTC_2020.csv
33
inc/*
44
__pycache__/*
5-
src/strategy_list/__pycache__/*
5+
src/strategy_list/__pycache__/*
6+
data/*

OpenTrade.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from pip import main
2-
from src.strategy import *
3-
from src.backtest import *
4-
from src.data import *
5-
from src.strategy_list.martingale import *
1+
from .src.strategy import *
2+
from .src.backtest import *
3+
from .src.data import *
4+
from .src.strategy_list.martingale import *

src/BTC_USD_2M.csv

Lines changed: 0 additions & 16959 deletions
This file was deleted.

src/backtest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,18 @@
11
import pandas as pd
22
import numpy as np
3-
3+
import os
44

55
class TradesStructure():
66
def __init__(self, name='Temp_name') -> None:
77
self.open_positions = {}
88
self.closed_positions = {} # [open_index, , open_price, close_idx, close_price]
99
self.profits = []
10-
self.log_file = open("./inc/"+name+".txt", "w")
10+
11+
path = "./inc/"+name+".txt"
12+
os.makedirs('./inc/', exist_ok=True)
13+
self.log_file = open(path, "w")
14+
15+
1116

1217
def __str__(self) -> str:
1318
return "-------- New Structure has been made -------- \n"

src/data.py

Lines changed: 0 additions & 43 deletions
This file was deleted.

src/strategy.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ def run(self):
2121
self.algo(idx=idx, date=date, open_price=open_price, high_price=high_price, low_price=low_price, close_price=close_price)
2222

2323
self.result_info()
24+
self.trades.log_file.close()
2425

2526
def get_params(self):
2627
pass

src/strategy_list/martingale.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ def result_info(self):
6565
print("Total number of Rounds : {}".format(self.num_rounds))
6666
print("\nThanks to using ((Martingale))")
6767

68-
6968
self.trades.log("", 2)
7069
self.trades.log("Total profit in this strategy : {:.2f}".format(self.trades.total_profit()))
7170
self.trades.log("APR : {:.2f}%".format((self.trades.total_profit()/self.invesment)*100))

0 commit comments

Comments
 (0)