@Brandon-Johnson thanks a lot. I will try
Posts made by alexgiul
RE: What kind of close price should I use for backtesting?
Thanks @backtrader , my problem is I dont understand how to obtain same results present on websites:
for clarification I show you an example:
https://www.justetf.com/en/etf-profile.html?isin=IE00B1YZSC51&tab=returns for this instruments I see annual returns, but if I execute a simple buy and hold strategy and add the AnnualReturn analyzer I got different results; in particular on justETF the annual return for 2015 is 8.23%, while on my backtest 6.87% and so on
Can you drive me in order to understand ?
Ps: for buy-and-hold strategy I used the code available here(Buy and Forget): https://www.backtrader.com/blog/2019-06-13-buy-and-hold/buy-and-hold/
What kind of close price should I use for backtesting?
in case of stocks, I have both close price and adjusted close price; in case of daily or longer time period what is the correct price to use?
RE: How to use BT for signal generation
Thanks @backtrader for your reply.
Today I am working on this part but I am confused and I am not sure doing the right thing.
I try to explain the goal, maybe you can give me your opinion and put me on right road.
I have a simple channel breakout strategy made by 2 indicators (entry channel breakout, exit channel breakout). The strategy backtested uses the entry channel breakout to enter the market long or short and then uses the "exit channel breakout" to close the position.
Now I will run the strategy (the original strategy or the SignalStrategy) every day on latest XX bar and I want to send an email when the entry signal is fired and another when it is time to exit.
Actually I was thinking to use original strategy and use order generated as "signals", what do you think?
And if it looks like acceptable how can I access the current order situation and type (long/short)?
RE: How to use BT for signal generation
From the last time I have read the documentation, it is now awesome!!!!
I found what I am looking for: https://cookbook.backtrader.com/documentation/signal_strategy/signal_strategy/
I am liking backtrader every day more!!!
Thanks guys behind this platform for your efforts
How to use BT for signal generation
I have developed a simple strategy, backtested it and now I would start doing some demo testing. The question is if it is possible to use BT to generate signals based on the same strategy I have backtested or should I use a different tool? Is there any example doing it?
How to plot close price +/- ATR
I havent too much experience with bt and I have an issue with a simple task.
I would realize this chart:
The profit target/loss target are simple close price +/- X times ATR(14).
I tried with following code:
# Add a ATR indicator for stop loss / take profit calculations self.atr = bt.indicators.ATR(self.datas, period=14) self.higher_band = 3*self.atr + self.dataclose self.lower_band = self.dataclose - self.atr
but I dont get higher_band/lower_band plotted on chart.
How can I do it?
Usage of backtrader with Soybean future
I am a newbie of backtrader and try to run simple backtesting stuff but I dont know how to configure it correctly...
I have copied the code here:
and adapted to my case
This is the paper I am trying to implement: https://kjtradingsystems.com/Act/davey0410.pdf
The first issue is how to configure the "comminssion" scheme for soybean...
I have taken the information from CME website (https://www.cmegroup.com/trading/agricultural/grain-and-oilseed/soybean_contract_specifications.html) and configure the commission in this way:
cerebro.broker.setcommission(commission=8, margin=2350, mult=5000, name=instrument_name) # soybean
Running the code I get very big profit/loss and I suppose to have mis-configured the commission scheme.
The goal of this project is to get the same results as the author of paper.
Any help is very appreciated,
RE: Paper trading with Interactive Broker, how to request delayed data?
@albertzgd so you was able to use your paper account or the "demo" account to retrieve the delayed stream?
The prices retrieved with "demo" account is clutter (I read it somewhere)