package Ġorg . k ent unc . bit tr ader . c andle . api . application Ċ Ċ import Ġorg . k ent unc . bit tr ader . c andle . api . domain . model . strategy . Strategy Values Id Ċ import Ġorg . k ent unc . bit tr ader . c andle . api . domain . model . strategy . Trading Strategy Ċ import Ġorg . k ent unc . bit tr ader . c andle . api . domain . service . C andle Service Ċ import Ġorg . k ent unc . bit tr ader . c andle . api . domain . service . Strategy Service Ċ import Ġorg . k ent unc . bit tr ader . common . domain . model . c andle . C andle Query Ċ import Ġorg . k ent unc . bit tr ader . common . domain . model . market . Product Code Ċ import Ġorg . k ent unc . bit tr ader . common . domain . model . time . Duration Ċ import Ġorg . springframework . beans . factory . annotation . Value Ċ import Ġorg . springframework . stereotype . Service Ċ Ċ @ Service Ċ class ĠStrategy Interactor ( ĊĠĠĠ Ġprivate Ġval Ġc andle Service : ĠC andle Service , ĊĠĠĠ Ġprivate Ġval Ġstrategy Service : ĠStrategy Service , ĊĠĠĠ Ġ@ Value ("\ ${ bit tr ader . strategy . strategy - c andle - num }") Ġprivate Ġval Ġstrategy C andle Num : ĠInt , ĊĠĠĠ Ġ@ Value ("\ ${ bit tr ader . strategy . optimize - c andle - num }") Ġprivate Ġval Ġoptimize C andle Num : ĠInt , Ċ ) Ġ{ ĊĊĠĠĠ Ġsuspend Ġfun Ġget Trading Strategy ( product Code : ĠProduct Code , Ġduration : ĠDuration ): ĠTr ading Strategy Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġc andle Query Ġ= ĠC andle Query ( product Code , Ġduration , Ġstrategy C andle Num ) ĊĠĠĠĠĠĠĠ Ġval Ġc andle List Ġ= Ġc andle Service . find Latest ( c andle Query ) ĊĠĠĠĠĠĠĠ Ġval Ġstrategy Values Id Ġ= ĠStrategy Values Id ( product Code , Ġduration ) ĊĊĠĠĠĠĠĠĠ Ġreturn Ġstrategy Service . get Strategy ( c andle List , Ġstrategy Values Id ) ĊĠĠĠ Ġ} ĊĊĠĠĠ Ġsuspend Ġfun Ġoptimize Str ategies ( product Code : ĠProduct Code , Ġduration : ĠDuration ) Ġ{ ĊĠĠĠĠĠĠĠ Ġval Ġc andle Query Ġ= ĠC andle Query ( product Code , Ġduration , Ġoptimize C andle Num ) ĊĠĠĠĠĠĠĠ Ġval Ġc andle List Ġ= Ġc andle Service . find Latest ( c andle Query ) ĊĠĠĠĠĠĠĠ Ġval Ġstrategy Values Id Ġ= ĠStrategy Values Id ( product Code , Ġduration ) ĊĊĠĠĠĠĠĠĠ Ġstrategy Service . optimize ( c andle List , Ġstrategy Values Id ) ĊĠĠĠĠĠĠĠĠĠĠĠ Ġ? . also Ġ{ Ġstrategy Service . update Params ( strategy Values Id , Ġit ) Ġ} ĊĠĠĠ Ġ} Ċ } Ċ