Library "two_ma_logic" The core logic for the two moving average strategy that is used as an example for the internal logic of the "Template Trailing Strategy" and the "Two MA Signal Indicator" ma(source, maType, length) ma - Calculate the moving average of the given source for the given length and type of the average Parameters: source (float) : -...
This EMA uses a higher time sampled method instead of using security to gather higher timeframe data. Its quite fast and worked well with the timeframes prescribed, up to 8hrs, after 8hrs, the formatting gets more complicated and i probably wouldn't use it anyway. You can use this as a guide to avoid security and even f_security with this method. NOTE: This...
📑 Showcase This is ready-to-show indicator version of the example code form the `motion` library. It can be used to create string- or color-based effects. Library: ================================================================================ 📑 Setup To use this library in your own scripts, you must first import it. To do this, add the following line to...
An example of how to implement Ichimoku in other scripts using my `lib-hlm`. You can copy and paste this code into any `\\@version=5` indicator to add Ichimoku to it.
An example and overview of the syminfo and tickerid functions to be able to access different tools. Here is an example of accessing the Bitfinex exchange (and requesting "instrument name") when another exchange is open (BINANCE:BTCUSDT) There is a difference in name between BINANCE:BTCUSDT and BITFINEX:BTCUSD exchanges Try swapping // T =...
Simple Example Table for Displaying Price, RSI, Volume of multiple Tickers on selected Timeframe Displays Price, RSI and Volume of 3 Tickers and Timeframe selected by user input Conditional Table Cell coloring Price color green if > than previous candle close and red if < previous candle close RSI color green if < 30 and red if > 70 (RSI14 by default) Volume...
'Study forloop' pinescript Program to print star Triangle The Program Logic For example, the following Pinescript programme will need two nested for loops. The outer forloop is for rows and the inner forloop is for columns or stars. to create a triangle shape.
This is an example script for checking how far the current bar has progressed towards it's completed state. This works for any time frame, eliminating extra logic calls and conversions for each timeframe.period. It is not intended to be a standalone indicator, but rather as a resource for additional logic triggers on the real time bar of a pine script. The main...
In the v5 version of PineScript, casting a string to a float - float(x) - does not appear to work, in spite of the reference manual seemingly indicating that it should. The simplest test case that I could generate "float('4750.0')" would result in a "Cannot call 'float' with argument 'x'='4750.0'. An argument of 'literal string' type was used but a 'const float'...
just a example on how to edit line style on the output of the polynomial regression library..
This is a simple strategy that demonstrates how to easily incorporate a date range into a strategy. This allows you to limit your backtesting to a specific range of dates, which is vital if you want to compare different time frames. To use: Copy the code block between the '////' lines into your strategy. Add the variable 'inDateRange' to your entry and/or...
About this script: This example aims to highlight an alternative way to view HTF data by providing basic interpolation functionality. This script does not aim to provide use in itself as an indicator or strategy. Reason for study: Educational Purposes Only
Example function of a markov chain monte carlo simulation.
a test case for the KDE function on price delta. the KDE function can be used to quickly check or confirm edge cases of the trading systems conditionals.
The retracement tracker function(s) in this script outline how to: Track conditions using "toggle" booleans. Use multiple coinciding conditions to trigger an event just once. What is a retracement? "Retracements are temporary price reversals that take place within a larger trend. The key here is that these price reversals are temporary and do not...
This is an example of how to reference higher timeframe data without the need for a 'security()' call. I have attempted to create the function example: f_insecurity() with the purpose of wrapping up and pumping out all common relevent HTF price data that's needed for your everyday indicators in a reliable fashion.
This is a simple exit example in $$ (symbol's currency) for educational purpose .
This is a stepped trailing exit example for educational purpose . Short brief. There are 1 stop loss and 3 profit levels. When first tp is reached we move stop loss to break-even. When second tp is reached we move stop loss to first tp. When third tp is reached we exit by profit.