change parameters

This commit is contained in:
c9s 2020-06-19 00:10:43 +08:00
parent 9099a4a61b
commit b6909e654a
2 changed files with 7 additions and 7 deletions

View File

@ -28,7 +28,7 @@ func VolumeByPriceChange(market Market, currentPrice float64, change float64, si
if side == binance.SideTypeSell {
volume *= SellVolumeModifier(currentPrice)
} else {
volume *= volume*BuyVolumeModifier(currentPrice)
volume *= BuyVolumeModifier(currentPrice)
}
// at least the minimal quantity
@ -46,7 +46,7 @@ func VolumeByPriceChange(market Market, currentPrice float64, change float64, si
}
func BaseVolumeByPriceChange(change float64) float64 {
return 0.12 * math.Exp((math.Abs(change)-3100.0)/1600.0)
return 0.2 * math.Exp((math.Abs(change)-3100.0)/1600.0)
// 0.116*math.Exp(math.Abs(change)/2400) - 0.1
}

View File

@ -25,7 +25,7 @@ func TestVolumeByPriceChange(t *testing.T) {
change: 50,
side: binance.SideTypeBuy,
},
want: 0.00106382,
want: 0.00444627,
},
{
name: "buy-change-100-at-9200",
@ -35,7 +35,7 @@ func TestVolumeByPriceChange(t *testing.T) {
change: 100,
side: binance.SideTypeBuy,
},
want: 0.00108695,
want: 0.00560308,
},
{
name: "sell-change-100-at-9500",
@ -45,7 +45,7 @@ func TestVolumeByPriceChange(t *testing.T) {
change: 100,
side: binance.SideTypeSell,
},
want: 0.00249052,
want: 0.00415086,
},
{
name: "sell-change-200-at-9600",
@ -55,7 +55,7 @@ func TestVolumeByPriceChange(t *testing.T) {
change: 200,
side: binance.SideTypeSell,
},
want: 0.00265114,
want: 0.00441857,
},
{
name: "sell-change-500-at-9600",
@ -65,7 +65,7 @@ func TestVolumeByPriceChange(t *testing.T) {
change: 500,
side: binance.SideTypeSell,
},
want: 0.00390591,
want: 0.00650985,
},
}
for _, tt := range tests {