mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
change parameters
This commit is contained in:
parent
9099a4a61b
commit
b6909e654a
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Reference in New Issue
Block a user