Skip to content

Simple simulation doesn't work #1

@MaxBareiss

Description

@MaxBareiss

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
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions