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

PaperTrade dont fill

LORDofDOOM opened this issue · comments

I don't know if PaperTrade is a WIP, but should a "PaperTrade" order not always be filled (buy) to get results for proper testing ?

Currently it will get cleaned/canceled with "CancelUnboughtOrders()" because there is no fill.

The idea behind the PaperTradeManager is that it mimics the LiveTradeManager as close as possible to get an idea of what is bought and what isn't. Since no actual orders are placed on an exchange this is obviously not entirely possible. However, just like on an actual exchange your orders may not always be filled. Since you have a few different options when placing a buy order (to buy it for a lower price than the current price) it checks if the price you put the order on got hit after it was placed.

Thank you for your fast answer.

I know that there is no "real" fill made, but on other bots a "PaperTrade" is just filled with current value to test e.g. weekly performance or stop loss triggers.

In our current case I see that the bot want to buy on a strategy but because the order is not filled I cant check exit strategies or triggers.

Hmm ok, I get your point. The behavior you're describing seems to be somewhere between what the Backtester does and what the current paper trader does. We could probably introduce a boolean in the paper trader constructor that toggles either insta buying or checking the market for an actual order being hit?

I saw this behavior too wouöd be a good solution to fill or check the market

To make things less complicated I think the fastest solution is to set the fill to last candle price. Thats not exactly accurate but we can test strategy triggers for sell and trailing stop loss.

Thank you for look into this :-)

Just pushed a commit to develop that should include this behavior. You can give a new enum value called OrderBehavior.AlwaysFill to the PaperTradeManager constructor. This ensures that your order will be filled within the next SellTimer check :)

Great - Thank you

I'll give this a try ASAP :-)

@LORDofDOOM Did you manage to get around to testing this?

It works fine I tested it.

I'll close this for now, if there's something wrong we can create a new issue.