sthewissen / Mynt

An Azure Functions-based crypto currency trading bot; featuring 10 exchanges, 25 indicators, custom strategy support, backtester and more

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Feedback on Develop

ASADeveloper opened this issue · comments

Hi guys,

I just wanted to say that I've spent a couple of days on this project and specially on the Develop branch. I know that you're still working on it. Keep up the good work :-)

There are a few problems with the code and therefore the result is wrong. To give you an example in GenericTradeManager.GetAdvice which is one of the most important part of the project this code is used: (at this moment)

private async Task<ITradeAdvice> GetAdvice(string tradeMarket)
    {
        var minimumDate = DateTime.UtcNow.AddHours(**-120**);
        var candleDate = new DateTime(DateTime.**Now**.Year, DateTime.**Now**.Month, DateTime.**UtcNow**.Day, DateTime.**Now**.Hour, 0, 0, 0);
        var candles = await _api.GetTickerHistory(tradeMarket, minimumDate, Core.Models.Period**.Hour**);

        // We eliminate all candles that aren't needed and the last one (if it's the current running candle).
        candles = candles.Where(x => x.Timestamp > minimumDate && x.Timestamp < candleDate).ToList();

        // Get the date for the last candle we have left.
        var signalDate = candles[candles.Count - 1].Timestamp;

        // This is an outdated candle...
        if (signalDate < DateTime.**UtcNow**.AddMinutes**(-120)**)
            return null;

        // This calculates an advice for the next timestamp.
        var advice = _strategy.Forecast(candles);

        return advice;
    }

Shouldn't you use Utc datetime all the time?
And are you always use -120 hours minimumDate and minutes for outdated candles? Are these not the base values for most strategy calculations?

You did a fine job with this project, but adding more and more features doesn't help it I'm afraid. The current basic features doesn't work well. Another example is the dryRunning. It gave me a lot of errors when tryParse the OrderId from "DRY_RUN_SELL_123456" to a long variable and a few other things as well. But don't remember them now.

Another thing was the fact that somehow I get many runtime exceptions on the strategies. But I'm not sure why. Somehow the SMA(200) on The Scalper strategy is always null and there is not null check on it I guess.

Thanks for your interest in the project! The develop branch is very much a work in progress at this point. To answer a few of your questions:

Shouldn't you use UTC datetime all the time?
Yes it should. Fixed in develop now.

And are you always use -120 hours minimumDate and minutes for outdated candles? Are these not the base values for most strategy calculations?
Correct. Currently the timeframe for this is always set to an hour. Most likely what will happen in the future is that the strategy decides which timeframe it is going to be run on. That way we can calculate the value that is currently hardcoded as 120.

The dry running order ID was actually fixed a bit before you posted this. Also the 200 SMA cannot be calculated because of the 120 hours thing above, meaning it simply doesn't have enough data to calculate a 200 period moving average because there are only 120 candles retrieved. This should also be fixed as soon as each strategy can determine its own timeframe as mentioned above.

All of the above issues are fixed in develop as far as I can tell. If you find any new issues please create new issues for them, thanks!