Probably write new data feed class which reads StringIO objects.
Posts made by ab_trader
RE: Same entry, different exits
If you don't want to put several strategies into the system, then you can write single strategy with exit type parameter. Based on this parameter you can run different pieces of code in the
if self.p.param == somethingstatements.
RE: Is there some ways to add and drop data dynamicly?
@tianjixuetu this is english speaking community even (I am more than sure) English is a second language for majority of the users here. But they are making the effort and use it. Your post shows disrespect to other users, and your answer is not useful for community. Please use English.
RE: How am i sure buy and sell order are executed immediately ?
According to your code:
- you print
BUY @price...notification for any order, not only for
SELL@price...can only be printed if you have no position in the
data0, also this notification will be printed for any order, not
- you print
RE: While backtesting is there a way to assume that I buy at limit price instead of close price?
@Suraj-Thorat if you put the
limitorder in correct way, than it is executed at limit price.
RE: I backtest a strategy about futures,but I find there something strange about the profit
there is something different between your case and my case. you let the margin equals 2000 forever,but in real world,
the margin may be change awlays the price volitility.
Real world is different, you may want to educate your self a little bit more on this.
Sometimes margin doesn't fluctuate with the daily prices, even it still depends on volatility.
Also an advice - post the script you use in the very first message, not in the very last. There are no mid readers here, so only you know what is ran. My simplified case shows that
btworks as expected, therefore the reason of the discrepancy is in (a) your additions to the
btor (b) in your calculations posted here. Seems it is case (b).