TradingView
dandrideng
2022年3月22日早上7點40分

simple_squares_regression 

Cosmos / TetherUS PERPETUAL CONTRACTBinance

描述

Library "simple_squares_regression"
simple_squares_regression: simple squares regression algorithm to find the optimal price interval for a given time period

basic_ssr(series, series, series) basic_ssr: Basic simple squares regression algorithm
  Parameters:
    series: float src: the regression source such as close
    series: int region_forward: number of candle lines at the right end of the regression region from the current candle line
    series: int region_len: the length of regression region
  Returns: left_loc, right_loc, reg_val, reg_std, reg_max_offset

search_ssr(series, series, series, series) search_ssr: simple squares regression region search algorithm
  Parameters:
    series: float src: the regression source such as close
    series: int max_forward: max number of candle lines at the right end of the regression region from the current candle line
    series: int region_lower: the lower length of regression region
    series: int region_upper: the upper length of regression region
  Returns: left_loc, right_loc, reg_val, reg_level, reg_std_err, reg_max_offset

發布通知

v2 Update usage samples and charts
評論
NET_WORTH_SOLUTIONS
Looks good. I understand what 'Optimal Price' is, and I'm know how to determine the slope and intercepts for a line using least squares analysis to determine best fit (I don't know how closely related that would be to some of the functions you've included on your library), but I'm unclear on how to use this library. Would you be willing to expand the explanation, or include so images that demonstrate a use case of two? That would be very helpful I think.
dandrideng
@NET_WORTH_SOLUTIONS, Thank you for your kind reply. I will update the script and chart for flexible usage.
更多