{"action":"created","issue":{"url":"https://api.github.com/repos/mementum/backtrader/issues/105","repository_url":"https://api.github.com/repos/mementum/backtrader","labels_url":"https://api.github.com/repos/mementum/backtrader/issues/105/labels{/name}","comments_url":"https://api.github.com/repos/mementum/backtrader/issues/105/comments","events_url":"https://api.github.com/repos/mementum/backtrader/issues/105/events","html_url":"https://github.com/mementum/backtrader/issues/105","id":163764153,"number":105,"title":"Order execution logic with current day data","user":{"login":"qqgit","id":5288042,"avatar_url":"https://avatars.githubusercontent.com/u/5288042?v=3","gravatar_id":"","url":"https://api.github.com/users/qqgit","html_url":"https://github.com/qqgit","followers_url":"https://api.github.com/users/qqgit/followers","following_url":"https://api.github.com/users/qqgit/following{/other_user}","gists_url":"https://api.github.com/users/qqgit/gists{/gist_id}","starred_url":"https://api.github.com/users/qqgit/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qqgit/subscriptions","organizations_url":"https://api.github.com/users/qqgit/orgs","repos_url":"https://api.github.com/users/qqgit/repos","events_url":"https://api.github.com/users/qqgit/events{/privacy}","received_events_url":"https://api.github.com/users/qqgit/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mementum/backtrader/labels/question","name":"question","color":"cc317c"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-05T03:08:38Z","updated_at":"2016-07-05T18:16:24Z","closed_at":null,"body":"Hi mementum,\r\n    One order execution logic of backtrader is:\r\n             **\"The current data has already happened and cannot be used to execcute an order.\"** \r\n    However, in reality the current bar data includes OHLC prices with the open price comes first and close price last. In the current day, I should have got open price and want to use it for my buy/sell decision (without known anything about high/low/close prices). \r\n    **The question is, how can I create an order that can be executed in current day, with knowledge of current open price** (certainly, the curent high/low/close prices are not used anywhere including in strategy indicator)?\r\n    Thanks!"},"comment":{"url":"https://api.github.com/repos/mementum/backtrader/issues/comments/230558628","html_url":"https://github.com/mementum/backtrader/issues/105#issuecomment-230558628","issue_url":"https://api.github.com/repos/mementum/backtrader/issues/105","id":230558628,"user":{"login":"mementum","id":5713511,"avatar_url":"https://avatars.githubusercontent.com/u/5713511?v=3","gravatar_id":"","url":"https://api.github.com/users/mementum","html_url":"https://github.com/mementum","followers_url":"https://api.github.com/users/mementum/followers","following_url":"https://api.github.com/users/mementum/following{/other_user}","gists_url":"https://api.github.com/users/mementum/gists{/gist_id}","starred_url":"https://api.github.com/users/mementum/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mementum/subscriptions","organizations_url":"https://api.github.com/users/mementum/orgs","repos_url":"https://api.github.com/users/mementum/repos","events_url":"https://api.github.com/users/mementum/events{/privacy}","received_events_url":"https://api.github.com/users/mementum/received_events","type":"User","site_admin":false},"created_at":"2016-07-05T18:16:23Z","updated_at":"2016-07-05T18:16:23Z","body":"If you use intraday data directly, you can then operate close to the opening. If you have *minute* resolution bars you can operate 1 minute after the opening, and this should give you a good entry point close to the opening. You also operate in `next` as a rule of thumb.\r\n\r\n`prenext` is called before all indicators are delivering meaningful data. In the simple case of a single moving average, `prenext` is called the n-1 periods before the average produces a data. After that `next` is called.\r\n\r\nData Replay needs smaller resolution data to give you larger resolution data. You can go from minutes to days. But you cannot go from day to day.\r\n\r\nHence the suggestion to simulate intraday data by breaking your daily bars into `open` + `high-low-close` bars and *replay* those 2 ticks."}}
{"actor":{"display_login":"mementum"}}