Learning Web Development (5)

So now I’ve dived a bit into the Gekko docs and it seems fairly simple to create a strategy. This is the thing that outputs the trading advice to Gekko. The tutorials I used are: https://www.youtube.com/watch?v=6-74ZhrG0BE&t=1456s and https://gekko.wizb.it/docs/strategies/creating_a_strategy.html

Now my strategy looks like this (just outputting some trivial things like in the youtube demo):

The JavaScript function from the strategy..
The output

Now Gekko can make use of strategies using all kinds of algorithms, but I don’t want that. I want to decide each day if I want to buy or sell on a specific input. For this I wrote a Web Api endpoint in C#. For my first test, like I showed you in the previous post, this just takes in an integer parameter and outputs a dummy object. I’ve changed this a bit from the previous post, and it now looks like this:

The Api controller method we will be calling from JavaScript..

After this I fiddled around a bit and got some https/SSL errors. Now I prefer to use https in production but I did not want to get into this for this demo so I disabled https redirection in my web api. After that I ran the strategy which now looks like this:

Calling the API from Gekko..

Resulting in this excerpt from when running Gekko from the command line:

Calling the API from Gekko…

This far it’s going smoothly. The next step will be to send something meaningful to the api, and returning from the api a buy or sell command…

Stay tuned..

Leave a Reply

Your email address will not be published. Required fields are marked *

Social Media Auto Publish Powered By : XYZScripts.com