pine-script

how pinescript code expression "?:" "if else" to python conversion

how pinescript code expression "?:" "if else" to python conversion Question: Sorry for my bad english. I am trying to set Pinescript code to Python. But I’m stuck on line 15. part of the original code // This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/ // author …

Total answers: 2

Trend Trigger Factor Indicator (TTF) in Python?

Trend Trigger Factor Indicator (TTF) in Python? Question: I am trying to convert TTF Indicator from TradingView Pine Script to Python. (with no plotting) This is the Pine Script code I am trying to convert: //@version=3 // Copyright (c) 2018-present, Alex Orekhov (everget) // Trend Trigger Factor script may be freely distributed under the MIT …

Total answers: 1

Standardization between float and None types

Standardization between float and None types Question: I have converted the code from Pine Script to Python, but I am facing some problems. I’m not good in Python. import pandas as pd import pandas_ta as ta close = pd.read_csv(‘close-MATIC.csv’) def Z_4(src, length, smooth): mean = ta.sma(src, length) vlo = src – mean std = ta.stdev(vlo, …

Total answers: 1

Pivot function results differ from TradingView

Pivot function results differ from TradingView Question: I’m using this code to calculate pivot points. def pivots_low(osc, LBR, LBL): pivots = [] for i in range(len(osc) – LBR): pivots.append(0) pivot = True if i > LBL: for j in range(1, LBR + 1): if osc[i] >= osc[i + j]: pivot = False for j in …

Total answers: 1

How to implement RSI Divergence in Python

How to implement RSI Divergence in Python Question: I was wondering is there any Python library that covers RSI-Divergence (difference between a fast and a slow RSI) or any guidence about how can I implement its algorithm in Python. Already asked question: Programmatically detect RSI divergence. One of the answer suggests quantconnect forum for the …

Total answers: 4