{"action":"opened","issue":{"url":"https://api.github.com/repos/mdeverdelhan/ta4j/issues/39","labels_url":"https://api.github.com/repos/mdeverdelhan/ta4j/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/mdeverdelhan/ta4j/issues/39/comments","events_url":"https://api.github.com/repos/mdeverdelhan/ta4j/issues/39/events","html_url":"https://github.com/mdeverdelhan/ta4j/issues/39","id":82725439,"number":39,"title":"Possible update for TimeSeries.run()","user":{"login":"lequer","id":10257507,"avatar_url":"https://avatars.githubusercontent.com/u/10257507?v=3","gravatar_id":"","url":"https://api.github.com/users/lequer","html_url":"https://github.com/lequer","followers_url":"https://api.github.com/users/lequer/followers","following_url":"https://api.github.com/users/lequer/following{/other_user}","gists_url":"https://api.github.com/users/lequer/gists{/gist_id}","starred_url":"https://api.github.com/users/lequer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lequer/subscriptions","organizations_url":"https://api.github.com/users/lequer/orgs","repos_url":"https://api.github.com/users/lequer/repos","events_url":"https://api.github.com/users/lequer/events{/privacy}","received_events_url":"https://api.github.com/users/lequer/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-05-30T06:44:00Z","updated_at":"2015-05-30T06:44:00Z","closed_at":null,"body":"Currently, when running TimeSeries.run(strategy). the tradingRecord does not record the entry price for the trade, it always return Decimal.NAN. So the StopLossRule and the StopGainRule never actually work  when used like that. \r\nNow that you have TradingRecord.enter() and TradingRecord.exit(), is it possible to pass the trade amount and store the entry price when running the strategy?\r\n\r\nSomething along those line?\r\n```java\r\n    public TradingRecord run(Strategy strategy, OrderType orderType, Decimal amount) {\r\n\r\n        log.trace(\"Running strategy: {} (starting with {})\", strategy, orderType);\r\n        TradingRecord tradingRecord = new TradingRecord(orderType);\r\n\r\n        for (int i = beginIndex; i <= endIndex; i++) {\r\n            // For each tick in the sub-series...\r\n            if (strategy.shouldEnter(i, tradingRecord)) {\r\n                tradingRecord.enter(i, amount, ticks.get(i).getClosePrice());\r\n            }\r\n            if (strategy.shouldExit(i, tradingRecord)) {\r\n                tradingRecord.exit(i, amount, ticks.get(i).getClosePrice());\r\n            }\r\n        }\r\n// ....\r\n```\r\nThank you for the consideration."}}