|
@@ -30,6 +30,10 @@ func CreateOrder(
|
|
|
return errors.New("`CreateOrder`: unknown Side for the current strategy")
|
|
|
}
|
|
|
|
|
|
+ if !rm.EnsureVolatility(symbol) {
|
|
|
+ return sentio.ErrLowVolatility
|
|
|
+ }
|
|
|
+
|
|
|
bid = sentio.ToFixed(quotes[symbol].BidPrice, 2)
|
|
|
tp = sentio.ToFixed(rm.TakeProfit(symbol, bid), 2)
|
|
|
sl = sentio.ToFixed(rm.StopLoss(symbol, bid), 2)
|
|
@@ -62,7 +66,7 @@ func CreateOrder(
|
|
|
sentio.SHORT == t && stamp.Value < threshold {
|
|
|
|
|
|
// create a new order
|
|
|
- if size = uint(math.Floor(account.GetCash() * .8 / bid)); size < 1 {
|
|
|
+ if size = uint(math.Floor(account.GetCash() * .9 / bid)); size < 1 {
|
|
|
return sentio.ErrTooSmallOrder
|
|
|
}
|
|
|
|