Closed neilsmurphy closed 4 years ago
Could you please add an appropriate test for that. This is a core simulating broker of Backtrader - it is very sensitive IMHO and need to be properly tested.
Agreed.
File submitted using pmin instead of plimit.
Tests created and added to backtrader test directory.
Although Daniel already merged this fix to his repo - it would be gr8 to publish this PR to his repo nevertheless - just for the sake of adding your test ( which is very good btw :-) ).
Although Daniel already merged this fix to his repo - it would be gr8 to publish this PR to his repo nevertheless - just for the sake of adding your test ( which is very good btw :-) ).
Thanks! Is there an easy way to publish from here? Or should I make a new pull request using a fresh clone of mementum/backtrader?
BTW this fix is not in Daniel's repo. Current code still using plimit instead of plow.
if plimit <= popen:
# open greater/equal than requested - sell more expensive
pmin = max(plow, plimit)
p = self._slip_down(plimit, popen, doslip=self.p.slip_open,
lim=True)
self._execute(order, ago=0, price=p)
BTW this fix is not in Daniel's repo. Current code still using plimit instead of plow.
my mistake - sorry - I was under impresstion the similar fix was submitted.
Is there an easy way to publish from here?
Unfortunately no - publishing the same branch to the memento/backtrader will bring all bunch of unrelated commits to the PR (all the diffs between backtrader2 and the original repo ) :-(
Or should I make a new pull request using a fresh clone of mementum/backtrader?
What I usually do is to create an additional branch at the latest merged revision in the backtrader2 repository and cherry-pick the changes from the PR branch. Then the PR could be created in Daniel repo from this additional branch. ( I know it is awkward - but this is what I figured out - would appreciate if you have a better idea
cherry-pick the changes from the PR branch I couldn't find a good solution for this and I don't know how you are cherry picking the pr branch.
I made a pr but it had all of the exisitng commits in it.
Would it make sense to rebase and then try to put in a pr that would have left the net outstanding items?
I made a pr but it had all of the existing commits in it.
That what I was talking about and was afraid it will happen.
Would it make sense to rebase and then try to put in a pr that would have left the net outstanding items?
this will not solve the problem since there are still differences between the two repositories ( README files, CI config, probably others). So the new PR should be built ( I'm doing it using 'git cherry-pick' command, while creating a new branch in the backtrader2 repository and then publishing the PR from this new branch).
If you would like I can do this - np.
As for now I'm suggesting to close the current PR you've opened in Daniel's repository - since it can't be submitted the way it is - it contains too much unrelated changes.
If you would like I can do this - np.
That would be awesome, thanks. I'm not great with GIT.
I closed the pr but then tried to delete the branch but I think that was a mistake? I was trying to delete the pr. I'm going to stop and let you run with this. I'm new to git and I don't want to upset the applecart too much.
I've opened the PR to our rep with the merge changes from Daniel's repository. Could you please approve - can't approve myself
I've opened the PR to our rep with the merge changes from Daniel's repository. Could you please approve - can't approve myself
Done. I'm going to try to do the cherry pick if you haven''t done it.
I'm going to try to do the cherry pick if you haven''t done it
I was going to do this right now - but if you like to try - no problem - go on. Update me if you need any help if you like.
I'm going to try to do the cherry pick if you haven''t done it
I was going to do this right now - but if you like to try - no problem - go on. Update me if you need any help if you like.
Hey Vlad, I'm not sure how to do this and don't want to mess things up. Would you mind doing this one and just jotting down the steps for me?
@vladisld Can you go ahead with this? I don't want to practice learning with the main repo. Could you also jot down steps to complete if it's not too inconvenient?
ps: thanks for the referral!
Sorry - there were a couple of very busy days at work - wasn't able to take care of this commit. Will try to complete it today-tomorrow.
Done: https://github.com/mementum/backtrader/pull/415
Sorry for being so late - as I said it was a very busy week for me at work - some crisis, you know.
Steps I took to upload to memento/backtrader repo:
On local dev machine in backtrader2 repository:
git branch slip_down_fix_upload git checkout slip_down_fix_upload
git cherry-pick --no-commit commit-id-earliest git cherry-pick ... git cherry-pick --no-commit commit-id-latest
git commit -a
git push origin slip_down_fix_upload
Done.
Issue #22
Existing code was allowing for slippage to execute trade outside of price range. Code should read 'plow'. All other examples of self.slipdown() in the module use 'plow'.
Using the sample script as input by @ab-trader
Data date, open, high, low, close, volume, openinterest
Previous output was:
Code correction results of testing in correct outputs.