Fontiramisu

fontilab

Fontiramisu 已更新   
Library "fontilab"
Provides function's indicators for pivot - trend - resistance.

pivots(src, lenght, isHigh) Detecting pivot points (and returning price + bar index.
  Parameters:
    src: The chart we analyse.
    lenght: Used for the calcul.
    isHigh: lookging for high if true, low otherwise.
  Returns: The bar index and the price of the pivot.

calcDevThreshold(tresholdMultiplier, closePrice) Calculate deviation threshold for identifying major swings.
  Parameters:
    tresholdMultiplier: Usefull to equilibrate the calculate.
    closePrice: Close price of the chart wanted.
  Returns: The deviation threshold.

calcDev(basePrice, price) Custom function for calculating price deviation for validating large moves.
  Parameters:
    basePrice: The reference price.
    price: The price tested.
  Returns: The deviation.

pivotFoundWithLines(dev, isHigh, index, price, dev_threshold, isHighLast, pLast, iLast, lineLast) Detecting pivots that meet our deviation criteria.
  Parameters:
    dev: The deviation wanted.
    isHigh: The type of pivot tested (high or low).
    index: The Index of the pivot tested.
    price: The chart price wanted.
    dev_threshold: The deviation treshold.
    isHighLast: The type of last pivot.
    pLast: The pivot price last.
    iLast: Index of the last pivot.
    lineLast: The lst line.
  Returns: The Line and bool is pivot High.

getDeviationPivots(thresholdMultiplier, depth, lineLast, isHighLast, iLast, pLast, deleteLines, closePrice, highPrice, lowPrice) Get pivot that meet our deviation criteria.
  Parameters:
    thresholdMultiplier: The treshold multiplier.
    depth: The depth to calculate pivot.
    lineLast: The last line.
    isHighLast: The type of last pivot
    iLast: Index of the last pivot.
    pLast: The pivot price last.
    deleteLines: If the line are draw or not.
    closePrice: The chart close price.
    highPrice: The chart high price.
    lowPrice: The chart low price.
  Returns: All pivot the informations.

getElIntArrayFromEnd() Get the last element of an int array.

getElFloatArrayFromEnd() Get the last element of an float array.

getElBoolArrayFromEnd() Get the last element of a bool array.

isTrendContinuation(isTrendUp, arrayBounds, lastPrice, precision) Check if last price is between bounds array.
  Parameters:
    isTrendUp: Is actual trend up.
    arrayBounds: The trend array.
    lastPrice: The pivot Price that just be found.
    precision: The percent we add to actual bounds to validate a move.
  Returns: na if price is between bounds, true if continuation, false if not.

getTrendPivots(trendBarIndexes, trendPrices, trendPricesIsHigh, interBarIndexes, interPrices, interPricesIsHigh, isTrendHesitate, isTrendUp, trendPrecision, pLast, iLast, isHighLast) Function to update array and trend related to pivot trend interpretation.
  Parameters:
    trendBarIndexes: The array trend bar index.
    trendPrices: The array trend price.
    trendPricesIsHigh: The array trend is high.
    interBarIndexes: The array inter bar index.
    interPrices: The array inter price.
    interPricesIsHigh: The array inter ishigh.
    isTrendHesitate: The actual status of is trend hesitate.
    isTrendUp: The actual status of is trend up.
    trendPrecision: The var precision to add in "iscontinuation" function.
    pLast: The last pivot price.
    iLast: The last pivot bar index.
    isHighLast: The last pivot "isHigh".
  Returns: trend & inter arrays, is trend hesitate, is trend up.

drawBoundLines(startIndex, startPrice, endIndex, endPrice, breakingPivotIndex, breakingPivotPrice, isTrendUp) Draw bounds and breaking line of the trend.
  Parameters:
    startIndex: Index of the first bound line.
    startPrice: Price of first bound line.
    endIndex: Index of second bound line.
    endPrice: price of second bound line.
    breakingPivotIndex: The breaking line index.
    breakingPivotPrice: The breaking line price.
    isTrendUp: The actual status of the trend.
  Returns: The lines bounds and breaking line.
發布通知:
v2

Added:
getResistances(resPrices, resBarIndexes, resWeights, resNbLows, resNbHighs, maxResis, rangePercentResis, pLast, iLast, isHighLast) Function to update array and trend related to pivot trend interpretation.
  Parameters:
    resPrices: Array that save resis prices.
    resBarIndexes: Array that save resis bar index.
    resWeights: Array that save resis weight (how much time a pivot got into a resis).
    resNbLows: Array that save nb low pivot in resis.
    resNbHighs: Array that save nb high pivot in resis.
    maxResis: Max number of resis in resis arrays.
    rangePercentResis: Percentage vertical range to be taken when finding res.
    pLast: The last pivot price.
    iLast: The last pivot bar index.
    isHighLast: The last pivot "isHigh".
  Returns: trend & inter arrays, is trend hesitate, is trend up.

getTopRes(nbShowRes, minTopWeight, resWeights, resPrices, resBarIndexes) Get top weighted resistance from multiple res found.
  Parameters:
    nbShowRes: Nb res we want to return .
    minTopWeight: Minimum res weight we want to return.
    resWeights: Res weight array.
    resPrices: Res prices array.
    resBarIndexes: Res bar index array.
@return The top arrays.

drawResLines(resPrices, resIndexes) Draw resistance lines for resistance indicator.
  Parameters:
    resPrices: Array of res prices.
    resIndexes: Array of res bar indexes.
發布通知:
v2 chart.
發布通知:
v4 : Resistance Script update & bug fix.
發布通知:
  • Bug Fix
發布通知:
v6 :
  • Fix bug
  • Change line style
發布通知:
v7

Added:
plotDivergences()
  Plot divergences.

getOscPivots()
  Used to get pivots and potential pivots.
發布通知:
v8

Added:
getHighLowFromNbCandles()
  to get last high/low (handle multiple rsiOver in a row)
發布通知:
v9

Added:
zlSma()
  calculate zero lag sma.

dema()
  to get dema.

multiMa()
  Select between multiple ma type.

getSlope()
  Get source slope.

getMZL()

demaSupertrend()
  to get Dema supertrend.

getRSI()
  get RSI.

getMACD()
  get MACD.
發布通知:
v10

Added:
tema()
  Tripple exponential moving average.

zlDema()
  Zero-lag Dema.

zlTema()
  Zero-lag Tema.

mcginley()
  McGinley Dynamic

Updated:
dema()
  Double Exponential Average.
發布通知:
v11

Added:
getTrendBands()
  get trend bands.
發布通知:
v12

Added:
getInterTrend()
  get trend brand from pivot/highs lows interpretation.

Pine腳本庫

本著真正的TradingView精神,作者將此Pine代碼以開源腳本庫發布,以便我們社群的其他Pine程式設計師可以重用它。向作者致敬!您可以私下或在其他開源出版物中使用此庫,但在出版物中重用此代碼受網站規則約束。

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。

想使用這個腳本庫嗎?

複製以下行並將其黏貼到您的腳本中。