You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# - Normally, user will create a strategy and embed it into Qlib's executor and simulator interaction loop
404
+
# For a _nested qlib example_, (Qlib Strategy) <=> (Qlib Executor[(inner Qlib Strategy) <=> (inner Qlib Executor)])
405
+
# - However, RL-based framework has it's own script to run the loop
406
+
# For an _RL learning example_, (RL Policy) <=> (RL Env[(inner Qlib Executor)])
407
+
# To make it possible to run _nested qlib example_ and _RL learning example_ together, the solution below is proposed
408
+
# - The entry script follow the example of _RL learning example_ to be compatible with all kinds of RL Framework
409
+
# - Each step of (RL Env) will make (inner Qlib Executor) one step forward
410
+
# - (inner Qlib Strategy) is a proxy strategy, it will give the program control right to (RL Env) by `yield from` and wait for the action from the policy
411
+
# So the two lines below is the implementation of yielding control rights
412
+
ifisinstance(res, GeneratorType):
413
+
res=yieldfromres
414
+
415
+
_inner_trade_decision: BaseTradeDecision=res
416
+
401
417
trade_decision.mod_inner_decision(_inner_trade_decision) # propagate part of decision information
402
418
403
419
# NOTE sub_cal.get_step_time() must be called before collect_data in case of step shifting
0 commit comments