{"action":"created","comment":{"url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments/26658500","id":26658500,"diff_hunk":"@@ -0,0 +1,84 @@\n+package ch.epfl.ts.engine\n+\n+import ch.epfl.ts.component.{ Component, StartSignal }\n+import ch.epfl.ts.data.Transaction\n+import scala.concurrent.duration.DurationInt\n+import scala.language.postfixOps\n+import ch.epfl.ts.data.Currency\n+\n+class RevenueComputeFX(traderNames: Map[Long, String]) extends Component {\n+  //Simple , just to have a functional output\n+  /*TODO : Change the architecture to use Wallet inside Trader component for strategies \n+involving current wallet state. ( example : buy order with 10% of total available fund)*/\n+  import context._\n+\n+  case class Wallet(var funds: Map[Currency.Value, Double])\n+\n+  var wallets = Map[Long, Wallet]()\n+  var currentTradingPrice: Double = 0.0\n+\n+  def receiver = {\n+    case t: Transaction => process(t)\n+    case _              =>\n+  }\n+\n+  def process(t: Transaction) = {\n+    currentTradingPrice = t.price\n+    if (traderNames.contains(t.buyerId)) {\n+      val traderId = t.buyerId\n+      val buyerWallet = wallets.getOrElse(t.buyerId, Wallet(Map(Currency.USD -> 5000, Currency.EUR -> 0)))","path":"src/main/scala/ch/epfl/ts/engine/RevenueComputeFX.scala","position":29,"original_position":29,"commit_id":"5d8d8591638ca6eb754a84f545f93f093dd82041","original_commit_id":"5d8d8591638ca6eb754a84f545f93f093dd82041","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":"Why is this hardcoded?","created_at":"2015-03-18T12:33:13Z","updated_at":"2015-03-18T12:33:13Z","html_url":"https://github.com/merlinND/TradingSimulation/pull/7#discussion_r26658500","pull_request_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7","_links":{"self":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments/26658500"},"html":{"href":"https://github.com/merlinND/TradingSimulation/pull/7#discussion_r26658500"},"pull_request":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7"}}},"pull_request":{"url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7","id":31182525,"html_url":"https://github.com/merlinND/TradingSimulation/pull/7","diff_url":"https://github.com/merlinND/TradingSimulation/pull/7.diff","patch_url":"https://github.com/merlinND/TradingSimulation/pull/7.patch","issue_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/7","number":7,"state":"open","locked":false,"title":"Simple adaptation to Forex (not ready to merge)","user":{"login":"kamilbs","id":5487171,"avatar_url":"https://avatars.githubusercontent.com/u/5487171?v=3","gravatar_id":"","url":"https://api.github.com/users/kamilbs","html_url":"https://github.com/kamilbs","followers_url":"https://api.github.com/users/kamilbs/followers","following_url":"https://api.github.com/users/kamilbs/following{/other_user}","gists_url":"https://api.github.com/users/kamilbs/gists{/gist_id}","starred_url":"https://api.github.com/users/kamilbs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kamilbs/subscriptions","organizations_url":"https://api.github.com/users/kamilbs/orgs","repos_url":"https://api.github.com/users/kamilbs/repos","events_url":"https://api.github.com/users/kamilbs/events{/privacy}","received_events_url":"https://api.github.com/users/kamilbs/received_events","type":"User","site_admin":false},"body":"**Do not merge for now**\r\n\r\n->Simple Adaptation to FX , need to refactor (to integrate (or not?) directly with the provided files : MarketFXSimulator -> MarketSimulator , MarketFXRules ->MarketRules , RevenueComputeFX->RevenueCompute) .\r\n\r\n->SimpleFXTrader\r\n->SimpleFXExample that run SimpleFXTrader\r\n\r\nThe output of RevenueComputeFX :\r\n\r\n![capture d ecran 2015-03-14 a 12 49 51](https://cloud.githubusercontent.com/assets/5487171/6651602/4d18bb44-ca49-11e4-8244-58fec5d1764b.png)\r\n is attached.","created_at":"2015-03-14T12:06:37Z","updated_at":"2015-03-18T12:33:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9e32abdf964924b1ff384c24451dfd41fd282be4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7/commits","review_comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7/comments","review_comment_url":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments{/number}","comments_url":"https://api.github.com/repos/merlinND/TradingSimulation/issues/7/comments","statuses_url":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/5d8d8591638ca6eb754a84f545f93f093dd82041","head":{"label":"merlinND:simplefxadapt","ref":"simplefxadapt","sha":"5d8d8591638ca6eb754a84f545f93f093dd82041","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-03-18T12:24:23Z","pushed_at":"2015-03-18T12:24:24Z","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":2078,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"base":{"label":"merlinND:master","ref":"master","sha":"2c7a59e7235daceaaa0c3d239d1ce0f5956d77e5","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-03-18T12:24:23Z","pushed_at":"2015-03-18T12:24:24Z","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":2078,"stargazers_count":1,"watchers_count":1,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":1,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7"},"html":{"href":"https://github.com/merlinND/TradingSimulation/pull/7"},"issue":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/issues/7"},"comments":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/merlinND/TradingSimulation/statuses/5d8d8591638ca6eb754a84f545f93f093dd82041"}}}}