![]() If unspecified (default), grid search is exhaustive, Number of runs to approximately that fraction of full grid space.Īlternatively, if integer, it denotes the absolute maximum number If max_tries is a floating value between (0, 1], this sets the If method="grid", this results in randomized grid search. Max_tries is the maximal number of strategy runs to perform. ![]() Model-based optimization, making at most max_tries evaluations. "skopt" which finds close-to-optimal strategy parameters using."grid" which does an exhaustive (or randomized) search over theĬartesian product of parameter combinations, and.Or a function that accepts this series object and returns a number Returns result pd.Series of the best run. Optimize strategy parameters to an optimal combination. Methods def optimize( self, *, maximize='SQN', method='grid', max_tries=None, constraint=None, return_heatmap=False, return_optimization=False, random_state=None, **kwargs) Trade/position, making at most a single trade (long or short) in effectĪt each time. If exclusive_orders is True, each new order auto-closes the previous ![]() If False, the opposite-facing orders first close existing trades in If hedging is True, allow trades in both directions simultaneously. With respect to the current bar's closing price instead of the If trade_on_close is True, market orders will be filled No difference is made between initial and maintenance margins. Margin is the required margin (ratio) of a leveraged account. Trading where the average spread is roughly 0.2‰ of asking price. set it to 0.0002 for commission-less forex Note, if you wish toĪccount for bid-ask spread, you can approximate doing so by increasing Is 1% of trade value, set commission to 0.01. Strategy is a Strategy subclass (not an instance).Ĭommission is the commission ratio. sentiment info).ĭataFrame index can be either a datetime index (timestamps) The passed data frame can contain additional columns thatĬan be used by the strategy (e.g. If any columns are missing, set them to what you have available,Į.g. Open, High, Low, Close, and (optionally) Volume. Backtest a particular (parameterized) strategy
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |