{"action":"created","comment":{"url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments/28690578","id":28690578,"diff_hunk":"@@ -1,14 +1,32 @@\n package ch.epfl.ts.traders\n \n+import scala.reflect.ClassTag\n+\n+import akka.actor.Props\n import ch.epfl.ts.component.Component\n+import ch.epfl.ts.component.ComponentBuilder\n+import ch.epfl.ts.component.ComponentRef\n import ch.epfl.ts.data.ParameterTrait\n+import ch.epfl.ts.data.StrategyParameters\n+import scala.reflect\n+\n+case class RequiredParameterMissingException(message: String) extends RuntimeException(message)\n \n /**\n  * Abstract class to be extended by all concrete Trader implementations.\n  * A Trader represents the implementation of a trading strategy.\n+ * \n+ * It factorizes parameter handling for concrete trading strategies.\n+ * \n+ * It will throw a `RequiredParmaeterMissingException` on instantiation if any of the\n+ * required parameters have not been provided (or have the wrong type).\n  */\n-abstract class Trader extends Component {\n+abstract class Trader(parameters: StrategyParameters) extends Component {\n+  /** Gives a handle to the companion object */\n+  def companion: TraderCompanion\n   \n+  // On instantiation, check that all mandatory parameters have been provided","path":"ts/src/main/scala/ch/epfl/ts/traders/Trader.scala","position":29,"original_position":29,"commit_id":"4dc069a6204435436ff0c22b1679635c5638ba63","original_commit_id":"4dc069a6204435436ff0c22b1679635c5638ba63","user":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"body":"This is required in case users decide to bypass `getInstance`, I would still like parameter checking to be done.","created_at":"2015-04-20T14:00:08Z","updated_at":"2015-04-20T14:00:08Z","html_url":"https://github.com/merlinND/TradingSimulation/pull/27#discussion_r28690578","pull_request_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27","_links":{"self":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments/28690578"},"html":{"href":"https://github.com/merlinND/TradingSimulation/pull/27#discussion_r28690578"},"pull_request":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27"}}},"pull_request":{"url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27","id":33424171,"html_url":"https://github.com/merlinND/TradingSimulation/pull/27","diff_url":"https://github.com/merlinND/TradingSimulation/pull/27.diff","patch_url":"https://github.com/merlinND/TradingSimulation/pull/27.patch","issue_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/27","number":27,"state":"open","locked":false,"title":"Use parameterizable strategies","user":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"body":"In this pull-request, I migrate existing trading strategies to use the proposed `Parameter` interface and demonstrate how it could be used to automatically test strategies over a range of valid values.","created_at":"2015-04-16T07:10:31Z","updated_at":"2015-04-20T14:00:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"981248c53942b580e78cb3175869231e9f812970","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27/commits","review_comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27/comments","review_comment_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/27/comments","statuses_url":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/4dc069a6204435436ff0c22b1679635c5638ba63","head":{"label":"merlinND:use-parameterizable-strategies","ref":"use-parameterizable-strategies","sha":"4dc069a6204435436ff0c22b1679635c5638ba63","user":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"repo":{"id":31139958,"name":"TradingSimulation","full_name":"merlinND/TradingSimulation","owner":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/merlinND/TradingSimulation","description":"TradingSimulation is a modular framework designed for back-testing trading strategies.","fork":true,"url":"https://api.github.com/repos/merlinND/TradingSimulation","forks_url":"https://api.github.com/repos/merlinND/TradingSimulation/forks","keys_url":"https://api.github.com/repos/merlinND/TradingSimulation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/merlinND/TradingSimulation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/merlinND/TradingSimulation/teams","hooks_url":"https://api.github.com/repos/merlinND/TradingSimulation/hooks","issue_events_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/events{/number}","events_url":"https://api.github.com/repos/merlinND/TradingSimulation/events","assignees_url":"https://api.github.com/repos/merlinND/TradingSimulation/assignees{/user}","branches_url":"https://api.github.com/repos/merlinND/TradingSimulation/branches{/branch}","tags_url":"https://api.github.com/repos/merlinND/TradingSimulation/tags","blobs_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/refs{/sha}","trees_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/{sha}","languages_url":"https://api.github.com/repos/merlinND/TradingSimulation/languages","stargazers_url":"https://api.github.com/repos/merlinND/TradingSimulation/stargazers","contributors_url":"https://api.github.com/repos/merlinND/TradingSimulation/contributors","subscribers_url":"https://api.github.com/repos/merlinND/TradingSimulation/subscribers","subscription_url":"https://api.github.com/repos/merlinND/TradingSimulation/subscription","commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/commits{/sha}","git_commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/commits{/sha}","comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/comments{/number}","issue_comment_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/comments{/number}","contents_url":"https://api.github.com/repos/merlinND/TradingSimulation/contents/{+path}","compare_url":"https://api.github.com/repos/merlinND/TradingSimulation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/merlinND/TradingSimulation/merges","archive_url":"https://api.github.com/repos/merlinND/TradingSimulation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/merlinND/TradingSimulation/downloads","issues_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues{/number}","pulls_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls{/number}","milestones_url":"https://api.github.com/repos/merlinND/TradingSimulation/milestones{/number}","notifications_url":"https://api.github.com/repos/merlinND/TradingSimulation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/merlinND/TradingSimulation/labels{/name}","releases_url":"https://api.github.com/repos/merlinND/TradingSimulation/releases{/id}","created_at":"2015-02-21T20:34:13Z","updated_at":"2015-04-16T07:09:11Z","pushed_at":"2015-04-20T12:52:55Z","git_url":"git://github.com/merlinND/TradingSimulation.git","ssh_url":"git@github.com:merlinND/TradingSimulation.git","clone_url":"https://github.com/merlinND/TradingSimulation.git","svn_url":"https://github.com/merlinND/TradingSimulation","homepage":"","size":4043,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":2,"default_branch":"master"}},"base":{"label":"merlinND:add-parameterizable-strategies","ref":"add-parameterizable-strategies","sha":"6e75458c9effbd85966edacace35d06a1cc60834","user":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"repo":{"id":31139958,"name":"TradingSimulation","full_name":"merlinND/TradingSimulation","owner":{"login":"merlinND","id":5563370,"avatar_url":"https://avatars.githubusercontent.com/u/5563370?v=3","gravatar_id":"","url":"https://api.github.com/users/merlinND","html_url":"https://github.com/merlinND","followers_url":"https://api.github.com/users/merlinND/followers","following_url":"https://api.github.com/users/merlinND/following{/other_user}","gists_url":"https://api.github.com/users/merlinND/gists{/gist_id}","starred_url":"https://api.github.com/users/merlinND/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/merlinND/subscriptions","organizations_url":"https://api.github.com/users/merlinND/orgs","repos_url":"https://api.github.com/users/merlinND/repos","events_url":"https://api.github.com/users/merlinND/events{/privacy}","received_events_url":"https://api.github.com/users/merlinND/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/merlinND/TradingSimulation","description":"TradingSimulation is a modular framework designed for back-testing trading strategies.","fork":true,"url":"https://api.github.com/repos/merlinND/TradingSimulation","forks_url":"https://api.github.com/repos/merlinND/TradingSimulation/forks","keys_url":"https://api.github.com/repos/merlinND/TradingSimulation/keys{/key_id}","collaborators_url":"https://api.github.com/repos/merlinND/TradingSimulation/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/merlinND/TradingSimulation/teams","hooks_url":"https://api.github.com/repos/merlinND/TradingSimulation/hooks","issue_events_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/events{/number}","events_url":"https://api.github.com/repos/merlinND/TradingSimulation/events","assignees_url":"https://api.github.com/repos/merlinND/TradingSimulation/assignees{/user}","branches_url":"https://api.github.com/repos/merlinND/TradingSimulation/branches{/branch}","tags_url":"https://api.github.com/repos/merlinND/TradingSimulation/tags","blobs_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/refs{/sha}","trees_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/trees{/sha}","statuses_url":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/{sha}","languages_url":"https://api.github.com/repos/merlinND/TradingSimulation/languages","stargazers_url":"https://api.github.com/repos/merlinND/TradingSimulation/stargazers","contributors_url":"https://api.github.com/repos/merlinND/TradingSimulation/contributors","subscribers_url":"https://api.github.com/repos/merlinND/TradingSimulation/subscribers","subscription_url":"https://api.github.com/repos/merlinND/TradingSimulation/subscription","commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/commits{/sha}","git_commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/git/commits{/sha}","comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/comments{/number}","issue_comment_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/comments{/number}","contents_url":"https://api.github.com/repos/merlinND/TradingSimulation/contents/{+path}","compare_url":"https://api.github.com/repos/merlinND/TradingSimulation/compare/{base}...{head}","merges_url":"https://api.github.com/repos/merlinND/TradingSimulation/merges","archive_url":"https://api.github.com/repos/merlinND/TradingSimulation/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/merlinND/TradingSimulation/downloads","issues_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues{/number}","pulls_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls{/number}","milestones_url":"https://api.github.com/repos/merlinND/TradingSimulation/milestones{/number}","notifications_url":"https://api.github.com/repos/merlinND/TradingSimulation/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/merlinND/TradingSimulation/labels{/name}","releases_url":"https://api.github.com/repos/merlinND/TradingSimulation/releases{/id}","created_at":"2015-02-21T20:34:13Z","updated_at":"2015-04-16T07:09:11Z","pushed_at":"2015-04-20T12:52:55Z","git_url":"git://github.com/merlinND/TradingSimulation.git","ssh_url":"git@github.com:merlinND/TradingSimulation.git","clone_url":"https://github.com/merlinND/TradingSimulation.git","svn_url":"https://github.com/merlinND/TradingSimulation","homepage":"","size":4043,"stargazers_count":2,"watchers_count":2,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":5,"forks":1,"open_issues":5,"watchers":2,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27"},"html":{"href":"https://github.com/merlinND/TradingSimulation/pull/27"},"issue":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/issues/27"},"comments":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/issues/27/comments"},"review_comments":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27/comments"},"review_comment":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/27/commits"},"statuses":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/4dc069a6204435436ff0c22b1679635c5638ba63"}}}}