@@ -71,7 +71,7 @@ func (ent *ExchangeEntity) Actions() []*ttypes.ActionDesc {
71
71
Description : "open long position" ,
72
72
Args : []ttypes.ArgmentDesc {
73
73
{
74
- Name : "stop_loss_trigge_price " ,
74
+ Name : "stop_loss_trigger_price " ,
75
75
Description : "Stop-loss trigger price" ,
76
76
},
77
77
{
@@ -254,12 +254,10 @@ func (ent *ExchangeEntity) HandleCommand(ctx context.Context, cmd string, args m
254
254
}
255
255
}
256
256
257
- log .Infof ("open %s position for signal %v, reason: %s" , ent .symbol , side , "" )
258
-
259
257
opts := make ([]interface {}, 0 )
260
258
261
259
// config stop losss
262
- if stopLoss , ok := args ["stop_loss_trigger_price" ]; ok {
260
+ if stopLoss , ok := args ["stop_loss_trigger_price" ]; ok && stopLoss != "" {
263
261
stopLoss , err := utils .ParseStopLoss (ent .vm , side , closePrice , stopLoss )
264
262
if err != nil {
265
263
return errors .Wrapf (err , "the stop loss invalid: %s" , stopLoss )
@@ -273,7 +271,7 @@ func (ent *ExchangeEntity) HandleCommand(ctx context.Context, cmd string, args m
273
271
}
274
272
275
273
// config take profix
276
- if takeProfix , ok := args ["take_profit_trigger_price" ]; ok {
274
+ if takeProfix , ok := args ["take_profit_trigger_price" ]; ok && takeProfix != "" {
277
275
takeProfix , err := utils .ParseTakeProfit (ent .vm , side , closePrice , takeProfix )
278
276
if err != nil {
279
277
return errors .Wrapf (err , "the take profit invalid: %s" , takeProfix )
@@ -286,6 +284,8 @@ func (ent *ExchangeEntity) HandleCommand(ctx context.Context, cmd string, args m
286
284
}
287
285
}
288
286
287
+ log .Infof ("open %s position for signal %v, options: %v" , ent .symbol , side , opts )
288
+
289
289
if cmd == "open_long_position" || cmd == "open_short_position" {
290
290
err := ent .OpenPosition (ctx , side , closePrice , opts ... )
291
291
if err != nil {
0 commit comments