- ago
I am trying to test a simple strategy using the new Binance extension. The strategy simply enters a position worth $15 for 5 bars, and then sells. However, all of the buy and sell signals result in the following error:
QUOTE:
Filter failure: LOT_SIZE




0
682
28 Replies

Reply

Bookmark

Sort
Glitch8
 ( 12.08% )
- ago
#2
This is mentioned in the Help for Binance. It could be that they are trying to deduct the commission, if you can put some assets into their BNB then they’ll use that for the fee instead of trying to deduct it from the sold asset.
1
Glitch8
 ( 12.08% )
- ago
#3
Perhaps we can have an option to automatically reduce the quantity behind the scenes to account for the fee.
1
- ago
#4
Thanks for the hint. That allowed the strategy to work for a little while, but now I've started getting "Error Canceling Order: Unknown order sent"

0
Glitch8
 ( 12.08% )
- ago
#5
Hmm it looks like you're not the only one that experiences this ... we may need to build in some retry logic to compensate for this:

https://github.com/askmike/gekko/issues/2762
1
Glitch8
 ( 12.08% )
- ago
#6
OK, I think we have this fixed now in the Binance Build 6 just uploaded. It turns out that we needed to truncate the decimals of the quantity down to the crypto symbol's specific setting. Even though Binance reports, say, a balance of 0.023976 for ETHUSD, the quantity needs to get adjusted to 0.02397 in order for the trade to fill. Seems like we're stuck with the 0.000006 left in the account but I believe you can close out a full coin position from their web site.
1
- ago
#7
I just started running some strategies with the latest version of the Binance extension, and now I'm seeing:
QUOTE:
Binance Broker: Error Placing OCO Order: Precision is over the maximum defined for this asset.


I have the precision for all crypto symbols defined as "8" in my "Markets and Symbols" settings. Do I need to manually reduce this?



UPDATE: Manually changing the decimal precision in the "Markets and Symbols" didn't seem to help, so I just deleted all of the entries I had made in there for Crypto. I assume (hope) the new "Use Fractional Shares" checkbox in the WL7 preferences makes it no longer necessary to manually define those settings in "Markets and Symbols".
0
Glitch8
 ( 12.08% )
- ago
#8
Binance already provides information on required precision, so you needn't define the symbols yourself manually.

After you removed the symbols are you still seeing the issue?

The new fractional shares preference applies to stock brokerages only, and only Alpaca supports it. Crypto brokerage extensions already support fractional shares.
0
- ago
#9
After removing the symbols from the "Markets and Symbols" list, I am no longer getting the error. But my strategy has been running all night without entering any positions, so I'm not sure if it's actually working now...

In comment #5 on this post, you mentioned that I needed to associate a symbol with the Crypto market:
https://www.wealth-lab.com/Discussion/Support-for-Fractional-Shares-6878

I assume that's still necessary. What value should I put for "Quantity Decimals" to avoid the Binance precision error?
0
Glitch8
 ( 12.08% )
- ago
#10
You actually don't need to make any association, the Extension automatically associated all of Binance's symbols to the Cryptos market and should pull in the required decimals, etc. If you see anything that does not look right let me know.
1
- ago
#11
Thank you for the clarification. I just tried running a couple more strategies on new symbols, but now I'm getting the precision error again. The symbols are no longer defined in my "Markets and Symbols" settings, so I'm not sure what's causing the error:

0
Glitch8
 ( 12.08% )
- ago
#12
Are you running Build 7 of the Binance Extension? I just successfully placed a buy for MATICUSD so I'm not sure where the problem is coming from at this point.
0
Glitch8
 ( 12.08% )
- ago
#13
I think I have a potential handle on this, stay tuned ...
1
- ago
#14
Confirmed that I'm on the latest version for everything. Thanks for continuing to investigate.

0
Glitch8
 ( 12.08% )
- ago
#15
The issue is that there is some rounding we need to do in the limit price, we didn’t submit limit orders to such a high decimal precision before. It’ll be an easy change and hopefully we can get an updated Binance Extension out tomorrow.
1
- ago
#16
Unfortunately, I still get this error after updating to today's version of WL7 and the Binance extension:

0
Glitch8
 ( 12.08% )
- ago
#17
Are you sure you have the latest Binance installed? The precsion for MATICUSD should be 4 decimals, and I'm seeing 5 in your screen shots. Is it linked to any symbol that you defined? Not sure where that 5 is coming from.
0
- ago
#18
Yeah, sorry, I'm not sure either. The error seems to happen for any symbol I've tried, so I don't think it's specific to MATIC.

0
Glitch8
 ( 12.08% )
- ago
#19
I’ll create a special build for you that has some extended logging, so we can track down why your symbols aren’t getting the proper precision. Can you email support@wealth-lab.com so i can get it off to you when ready. should be some time tomorrow.

One other thing i thought of, do you have Futures Mode enabled in Backtest Preferences? If so try disabling that and see if it makes a difference.
1
- ago
#20
Thanks, I'll send an email. If it's easier, I can just send the strategy over so you don't have to make any special build. Maybe the strategy design blocks are misconfigured in some way.

I don't have Futures Mode enabled. But I did just remember that I have "Adjust Entry/Exit Prices" enabled, for simulating slippage in my backtests, in case that's relevant.
0
Glitch8
 ( 12.08% )
- ago
#21
I don't think the Strategy will help. We need to determine why your orders aren't rounding propery. Let's just focus on MATICUSD for now, when I enter this order in the Order Manager (or have it sent from a Strategy) the OM rounds the quantity to 2 decimal places and the price to 4. But your price is rounding to 6+ decimals.

1
Glitch8
 ( 12.08% )
- ago
#22
I'm starting to susepct that the error message about the "illegal characters" is actually a failure in the request or response of the symbol info from Binance, this would explain why your symbols aren't truncating properly. A special debug build would verify that for us, but I'll continue along this assumption and see what might be causing that to fail.
1
- ago
#23
Just updated to Binance build 9, and now I see an error in the Log Viewer stating:

Error in GetUserCoins: Illegal characters found in a parameter.

0
- ago
#24
In case the error message was unimportant, I tried running a strategy anyway. The first thing that happens is the strategy attempts to sell, resulting in an "Account has insufficient balance" error:



But I have the "Reduce size of Exit Orders" preference checked. Should it prevent this error from occurring?

0
Glitch8
 ( 12.08% )
- ago
#25
Yes that’s ok. We knew the error is occurring, it should no longer prevent you from getting the coin precisions however. It should only prevent the coin names from being assigned.
1
Glitch8
 ( 12.08% )
- ago
#26
The Reduce option won’t work with Binance I’m afraid because Spot Balances are not considered Positions by their API.
1
- ago
#27
Okay, I unchecked the "Reduce size of Exit Orders" and ran the strategy. Unfortunately, I am now getting anHttpRequestException:

0
Glitch8
 ( 12.08% )
- ago
#28
Hmm that looks like an internet or server back end issue. I see the symbols have the proper precision now so we’ve made some progress.
0

Reply

Bookmark

Sort