![]() ![]() The BIGGER problem is, the PATTERN of the momentum study doesn't match up. I can get close using something around 1.325- but again, it's not exact. If I use '20' for X, the numbers are much too big. I'm using 1-min charts, so each row is a 1min candle. I think I figured out the PROBLEM- it's coming down to what I'm using for 'X'. NONE of them come close to what TOS is spitting out. I've tried many different versions of the squeeze codes out there, as well as my own. Once I get my answers as to what has the highest 'odds', then I can take it over and run it thru the TOS strategy. I'm using MySQL as I have 15yrs (excessive, I know) of 1-min chart data, and I want to run stats/probabilities on specific indicators and combination of indicators in conjunction with basic candle patterns/TA. Yes, I practically have the code memorized by this point! Default: 0 Kwargs: fillna (value, optional): pd.DataFrame.fillna(value) fill_method (value, optional): Type of fill method Returns: pd.DataFrame: %K, %D columns.Thank you for the reply. ![]() Default: 'sma' offset (int): How many periods to offset the result. Default: 3 mamode (str): See ```help(ta.ma)```. Default: 3 smooth_k (int): The Slow %D period. Sources: (STOCH) Calculation: Default Inputs: k=14, d=3, smooth_k=3 SMA = Simple Moving Average LL = low for last k periods HH = high for last k periods STOCH = 100 * (close - LL) / (HH - LL) STOCHk = SMA(STOCH, smooth_k) STOCHd = SMA(FASTK, d) Args: high (pd.Series): Series of 'high's low (pd.Series): Series of 'low's close (pd.Series): Series of 'close's k (int): The Fast %K period. The most common choices are a 14 period %K and a 3 period SMA for %D. The second line (%D) is a Simple Moving Average of the %K line. ![]() The first line (%K) displays the current close in relation to the period's high/low range. It is a range-bound oscillator with two lines moving between 0 and 100. He believed this indicator was a good way to measure momentum because changes in momentum precede changes in price. """Stochastic (STOCH) The Stochastic Oscillator (STOCH) was developed by George Lane in the 1950's. fillna ( method = kwargs, inplace = True ) # Name and Categorize it _name = "STOCH" _props = f "_ " df. ![]() fillna ( method = kwargs, inplace = True ) stoch_d. fillna ( kwargs, inplace = True ) if "fill_method" in kwargs : stoch_k. fillna ( kwargs, inplace = True ) stoch_d. shift ( offset ) # Handle fills if "fillna" in kwargs : stoch_k. loc, length = d ) # Offset if offset != 0 : stoch_k = stoch_k. loc, length = smooth_k ) stoch_d = ma ( mamode, stoch_k. max () stoch = 100 * ( close - lowest_low ) stoch /= non_zero_range ( highest_high, lowest_low ) stoch_k = ma ( mamode, stoch. Def stoch ( high, low, close, k = None, d = None, smooth_k = None, mamode = None, offset = None, ** kwargs ): """Indicator: Stochastic Oscillator (STOCH)""" # Validate arguments k = k if k and k > 0 else 14 d = d if d and d > 0 else 3 smooth_k = smooth_k if smooth_k and smooth_k > 0 else 3 _length = max ( k, d, smooth_k ) high = verify_series ( high, _length ) low = verify_series ( low, _length ) close = verify_series ( close, _length ) offset = get_offset ( offset ) mamode = mamode if isinstance ( mamode, str ) else "sma" if high is None or low is None or close is None : return # Calculate Result lowest_low = low. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |