mathisonian / mathisonian/benjamin

Simple simulation doesn't work

Open
#1 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
136
Forks
9
PR merge metrics
No merged PRs in 30d

Description

I'm using the latest version of the library, with node 0.10.17 . With this code, it downloads the latest trades, and then does nothing. What am I doing wrong? This is a really great idea for a library, and I'd like to help it succeed:

var Benjamin = require("benjamin");
var options = {
    client:{
        api_key:"BLAH",
        api_secret:"SEEKRIT"
    }
};
var benjamin = new Benjamin(options);

var strategy = {
    name:"Max-strategy",
    initialize:function(){
        console.log("Init!");
    },
    tick:function(Trades,currentSuggestion,callback){
        console.log("Here!");
        callback(0);
    },
    shouldExit:function(){
        return false;
    }
};

benjamin.use(strategy);

var start = Math.floor(Date.now()/1000)-31*24*60*60;
var end = Math.floor(Date.now()/1000);
benjamin.simulate({
    start: start, // UNIX-timestamps
    end: end,
    interval:15
});

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the supplied benjamin.simulate example with Node 0.10.17 and trace where execution stops after the trades download. Done means the cause of the missing strategy output is identified and the example either runs as expected or documents the required usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
fintech-quant
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.