En route to being absolutely the best and most complete trading platform out there, TradingView has just closed 2 gaps in their PineScript language.
It is now possible to create and backtest a strategy for trading with leverage.
Backtester now produces Margin Calls - so recognizes mid-trade drawdown and if it is too big for the broker to maintain your trade,...
Simple 3 EMA Strategy with plotted Take Profit and Stop Loss
- Middle EMA cross above the Slow EMA
- Set take profit and stop loss exit conditions based on ATR Indicator
- Fast EMA cross below the Middle EMA
Round function in PineScript is very simple and allows you to round numbers only to the closest integer number. This is a bit irritating because I very often have to round numbers to some decimal places and not integer.
So I created 2 functions I use all the time and now sharing them with you.
roundn - rounds the values in its first argument to the...
Example primarily focuses on:
• creating a simple function to get a time offset value
• using the offset to set drawing locations in the future
• how to properly set up and manipulate line positions
Extras ( end of script ):
• inclusion of vertical lines for visualising start and end points using the time offsets
• inclusion of label to read out the current...
This script is for a triple moving average indicator where the user can select from different types of moving averages and periods. This script improves upon tutorial 3 by adding source selection for MAs and another option for an MA that is not built-in, the HMA . It is meant as an educational script with well formatted styling, and references for specific functions.
we all know how moving averages suffer from lag - they have a delayed response to change in the underlying values - regardless if the underlying values are price movement or some kind of indicator formula that we are trying to smooth using a moving average.
here's a simple technique that can help minimize the lag built into the moving average - you can use this...
just publishing to share to novice pine coders like myself
any feedback on layout/structure/shortcuts will always be appreciated, not that this is a long script with much that can go wrong
short little what ever to show variable alert message
needs to draw the number from a plotted number like line 18 and 19, and cant be gettin the numbers from line 14 and 16
So far in this series of posts, we have worked thru creating a basic zero-lag moving average, then moved forward all the way to coding a "Fibonacci" Weighted Moving Average.
in this post we take a look at a technique that can help traders minimize noise in the underlying data and get better insight on the changes that are happening in the data series represented...
- I often see ppl struggeling do the first own strategy
- this is an example, for a smooth start
- EDIT it to your needs ( DELET my EXAMPELS and add your INPUTS/CONDITIONS)
- i added also a Backtestrange, so you can test your Strategy in different marketphases
- also added a trailing-stop-loss
3 Moving Average Lines. All parameters are configurable via user input.
Each of these moving average lines already exist as individual indicators in TradingView. This script just bundles them for one stop shopping. It's helpful if you're limited by the number of indicators per chart. And highly educational: quickly compare the different averaging methods!
This is the finalized code released to the public that I created in a video linked here.
This indicators combines a Bollinger Band and Stochastic RSI to produce signals for possible price reversal. The signals are displayed by default as green arrows for bullish and red arrows for bearish.
To trigger a signal the indicator checks for the following:
A small method to translate strings to numbers.
For example, we have a string:
s = "321"
To check if the last symbol is "1", we might just try to remove (or replace with an empty string) the symbol "1". If the string changed, then there was the symbol "1" in the string:
s2 = str.replace_all (s, "1", "")
now s2 is "32", so
s == s2 returns false.
But we can't...
Example of requesting Earnings, Splits, Dividends using pine-script.
That way is inner representation of data in TradingView, so it can be changed any time. It's just an example of requesting of the data.
Description of the series.
time: report date (unix time stamp)
open: estimate value
low: reported value
close: actual value
This time I took the pattern recognizer from a previous script I worked.
It overlays the Arrows on the chart.
#Maroon colour: Strong bearish signal
#Red colour: Bearish signal
#Dark Green colour: Strong bullish signal
#Lime: Bullish signal
NOTE: Also, you can untick the patterns you don't find useful, but I kept every pattern to get a complete...
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
Pinescript requires many of its built-in functions to use a simple int as their period length, which entails the period length cannot vary during the script's execution. These functions allow using a series int or series float for their period length, which means it can vary on each bar.
The functions shared in this script include:
Rolling sum: ...
Slow stochastic with ADX exhaustation and sell/entry points as orange/green circles.
This is a script I remade from Marco Valente's "RSI Combo" and Oshri17 "Slow stochastic".
Credits and thanks to them for sharing, I just expanded the diversity ^^
Hope you enjoy phit! ;D