Pinescript v3 Compatibility Framework (v4 Migration Tool)
This code makes most v3 scripts work in v4 with only a few minor changes below. Place the framework code before the first input statement.
You can totally delete all comments.
- to port to v4 you only need to make a few simple changes, not affecting the core v3 code functionality
This is an old and incomplete script that is being pulled up and dusted off as per request.
The sole purpose of this script was to provide code snippets allowing one to easily convert their own script/strategy to include incremental order sizes. More control over your pyramiding orders.
**It may repaint, and was not intended for trading but more as an attempt...
Example how to backtest specific date(s) which can be useful for testing seasonality strategy ideas such as "Sell in May", etc.
If using Daily period with wild card dates it will not trade on 1st day of month. If market is closed will trade on next open day.
Works only with Daily or lower timeframes. When using on Daily timeframe set dates 1 day earlier to...
Example how to color patterns of 3 bodies growing or waning by percentage with or without trend. Also included option for alert triggers. The yellow triangles on the chart denote where the alert triggers will fire.
• Choose Pattern Of Filter: shows bodies growing or waning or both.
• Sample Lengths Of AvgBar: number of recent bars to use for average size.
Simple signals example for Risk Management Wrapper
The unique part is that there is a single variable used for both Buy and Sell conditions.
Technically, a variable can have an infinity of values, so why not use that in our favour.
A value of -1 is used for the SELL alert condition , and a value of +1 is used for the BUY alert condition .
Example how to color the trigger bar of the condition and n-1 prior bars using only 1 barcolor() function.
Currently when offsets are used in barcolor(), bgcolor(), plot(), plotarrow(), plotchar(), or plotshape(), the offset only works with a simple (static) integer. If series (dynamic) integers are used instead, there is not an error, but the series values are...