DomSperanza / CryptoTrading

code to set up live trading bots with various trading strategies
2 stars 0 forks source link

Make backtesting be able to buy and sell for testing strategies. #4

Open DomSperanza opened 1 year ago

DomSperanza commented 1 year ago

Ill leave the Backtesting_v2 alone cause it does a very good job backtesting long positions for spot trading on Binance. This backtesting will focus more on a future margin account that will be able to use leverage to buy and sell postitions.

Shouldnt be too difficult as much of the same code will be part of backtesting script.

Only thing i cant find is commission rates for margin account. Like if you borrow a certain crypto and trade it, do you still have to pay the additional commission of .075% or does the fee only come in the form of interest on the stuff being borrow.

Gonna mess around on binance margin account doing small trades to fully figure out how much everything is being charged so i can get an accurate backtesting software build that reflects commissions.

Splutonics commented 1 year ago

Check out this library: https://www.backtrader.com/docu/quickstart/quickstart/

DomSperanza commented 1 year ago

Ive looked at backtrader before and other backtesting software out there. When trying to convert Pine script into python i was running into frustrating issues with getting the strategies programmed. Even looking at the backtrader software, it doesnt look super editable. Like implementing a much more complex strat might be annoying. Ill show you what i mean when we meet sometime this weekend. The robustness and editability of having my own homegrown backtesting is really nice.

DomSperanza commented 1 year ago

Got them moved over and have a path forward if i backtest new strats. Much easier to move to binance functions now to get all the TA indicators.

DomSperanza commented 1 year ago

oops closed the wrong one. Haaent looked into buying and selling yet.