RULE CHANGE
Custom Scripts
Page is back online, content unchanged.
+18 / -9 lines
▸ View exact changes
What the page said before and after
Before
Custom Scripts
Source: https://docs.myfundedperpetuals.com/guides/custom-scripts
− Write your own chart indicators in a Pine-style script language, with lines, colors, markers, background shading, and adjustable inputs.
Custom Scripts let you build your own indicators on the trade chart and the
trade journal chart. You write a short script, in a language modeled on
TradingView's Pine Script, and the chart draws the result on every candle.
There are two Custom Script indicators:
| Indicator | Where it draws |
|---|
| MFP Custom Script | Its own pane below the price chart, like RSI or MACD. |
| MFP Custom Script Overlay | On top of the candles, like a moving average. |
− [!NOTE]
− Custom Scripts are rolling out gradually. If you don't find them in the
− Indicators dialog, they aren't available on your account yet.
Add a script
1. Open the chart and select Indicators.
2. Search for MFP and choose MFP Custom Script or **MFP Custom Script
Overlay**.
3. Open the indicator's settings from its row in the chart legend.
4. On the Inputs tab, replace the text in the Script box with your
script and select Ok.
Your script is saved with your chart layout, so it comes back when you
reload the page. You can add each indicator more than once to run several
scripts side by side.
Scripts run only in your browser, on the candles already loaded on your
chart. A script can read prices and draw on the chart. It can't place
orders, change settings, or read anything else about your account, so a
script someone shares with you can't act on your behalf.
Fix errors
If a script has a mistake, the indicator draws nothing and a notice appears
at the bottom of the chart. The notice gives the line and column of the
problem and, where it can, a suggestion:
Line 2, column 6: Unknown name "clsoe". Did you mean "close"?
The notice clears as soon as the script is valid. You can dismiss it with
the close button; it stays hidden until a different error appears or you
− reload the page.
Write a script
A script is a list of statements, one per line. You can also separate
statements with a semicolon. Text after // is a comment.
// Two moving averages
fast = ema(close, 9)
slow = ema(close, 21)
plot(fast, "Fast", color=color.blue)
plot(slow, "Slow", color=color.orange)
- Names. fast = ema(close, 9) gives a value a name you can reuse on
later lines. Each name can be set once, and a name can't reuse a built-in
value such as close or na.
- One-line scripts. A script that is a single expression, such as
condition was true; 1 is the one before that, up to 9.
- min, max, and avg take 2 to 10 values.
Limits
| Limit | Value |
|---|---|
| Script length | 4,000 characters |
| Lines (plot and hline) | 8 |
| Markers (plotshape) | 4 |
| Inputs | 8 |
| History reference (close[n]) | 5,000 candles |
| Length of any one function | 5,000 candles |
| All function lengths in one script, added up | 20,000 candles |
The last limit keeps a script from slowing down your chart. A script over
− any limit shows an error instead of running.
Differences from Pine Script
− Many simple Pine Script indicators paste in with little or no change, and
− headers such as //@version=5 and indicator(...) are accepted. These parts
− of Pine Script aren't supported, and each shows an error explaining so:
- if, for, while, and switch blocks. Use condition ? a : b.
- var, reassigning with :=, and your own functions.
- Lists, tuples such as [a, b] = ..., and text other than titles.
- Data from other markets or timeframes (request.security).
- Strategies, alerts, fill, plotchar, plotarrow, and drawing objects
such as labels, lines, boxes, and tables.
- offset= on plots, and input.string, input.color, and
input.timeframe.
plotshape accepts text= and size=, but markers are drawn without text,
at the chart's standard size. alertcondition is accepted and has no effect.
Examples
MACD
fastLen = input.int(12, "Fast")
slowLen = input.int(26, "Slow")
macd = ema(close, fastLen) - ema(close, slowLen)
signal = ema(macd, 9)
hist = macd - signal
plot(hist, "Histogram", color = hist >= 0 ? color.green : color.red, style=plot.style_columns)
plot(macd, "MACD", color=color.blue)
plot(signal, "Signal", color=color.orange)
hline(0)
Use MFP Custom Script so it draws in its own pane.
After
Custom Scripts
Source: https://docs.myfundedperpetuals.com/guides/custom-scripts
+ Write your own chart indicators in the Custom Script language, a short Pine-style language with lines, colors, markers, background shading, and adjustable inputs.
Custom Scripts let you build your own indicators on the trade chart and the
trade journal chart. You write a short script, in a language modeled on
TradingView's Pine Script, and the chart draws the result on every candle.
There are two Custom Script indicators:
| Indicator | Where it draws |
|---|
| MFP Custom Script | Its own pane below the price chart, like RSI or MACD. |
| MFP Custom Script Overlay | On top of the candles, like a moving average. |
+ Scripts without a //@version line run on the Custom Script language
+ described here. On the trade chart, a script with a //@version line, such as
+ one copied from TradingView, runs as Pine Script instead, with more features
+ and higher limits: see Pine Scripts. The trade
+ journal chart runs every script in the Custom Script language.
Add a script
1. Open the chart and select Indicators.
2. Search for MFP and choose MFP Custom Script or **MFP Custom Script
Overlay**.
3. Open the indicator's settings from its row in the chart legend.
4. On the Inputs tab, replace the text in the Script box with your
script and select Ok.
Your script is saved with your chart layout, so it comes back when you
reload the page. You can add each indicator more than once to run several
scripts side by side.
Scripts run only in your browser, on the candles already loaded on your
chart. A script can read prices and draw on the chart. It can't place
orders, change settings, or read anything else about your account, so a
script someone shares with you can't act on your behalf.
Fix errors
If a script has a mistake, the indicator draws nothing and a notice appears
at the bottom of the chart. The notice gives the line and column of the
problem and, where it can, a suggestion:
Line 2, column 6: Unknown name "clsoe". Did you mean "close"?
The notice clears as soon as the script is valid. You can dismiss it with
the close button; it stays hidden until a different error appears or you
+ reload the page. When there is more than one, the notice shows the most
+ important first and counts the rest: errors and notices for the same
+ script, then for other scripts on the chart.
Write a script
A script is a list of statements, one per line. You can also separate
statements with a semicolon. Text after // is a comment.
// Two moving averages
fast = ema(close, 9)
slow = ema(close, 21)
plot(fast, "Fast", color=color.blue)
plot(slow, "Slow", color=color.orange)
- Names. fast = ema(close, 9) gives a value a name you can reuse on
later lines. Each name can be set once, and a name can't reuse a built-in
value such as close or na.
- One-line scripts. A script that is a single expression, such as
condition was true; 1 is the one before that, up to 9.
- min, max, and avg take 2 to 10 values.
Limits
| Limit | Value |
|---|---|
| Script length | 4,000 characters |
| Lines (plot and hline) | 8 |
| Markers (plotshape) | 4 |
| Inputs | 8 |
| History reference (close[n]) | 5,000 candles |
| Length of any one function | 5,000 candles |
| All function lengths in one script, added up | 20,000 candles |
The last limit keeps a script from slowing down your chart. A script over
+ any limit shows an error instead of running. These limits apply to the Custom
+ Script language only; Pine scripts have their own, listed in
+ Pine Scripts.
Differences from Pine Script
+ The Custom Script language covers a small part of Pine Script. These parts of
+ Pine Script aren't supported in it, and each shows an error explaining so:
- if, for, while, and switch blocks. Use condition ? a : b.
- var, reassigning with :=, and your own functions.
- Lists, tuples such as [a, b] = ..., and text other than titles.
- Data from other markets or timeframes (request.security).
- Strategies, alerts, fill, plotchar, plotarrow, and drawing objects
such as labels, lines, boxes, and tables.
- offset= on plots, and input.string, input.color, and
input.timeframe.
plotshape accepts text= and size=, but markers are drawn without text,
at the chart's standard size. alertcondition is accepted and has no effect.
+ On the trade chart, add a //@version=6 line at the top of the script to run
+ it as Pine Script, which supports these features. See
+ Pine Scripts. The trade journal chart doesn't run Pine
+ Script, so a script that uses them shows an error there.
Examples
MACD
fastLen = input.int(12, "Fast")
slowLen = input.int(26, "Slow")
macd = ema(close, fastLen) - ema(close, slowLen)
signal = ema(macd, 9)
hist = macd - signal
plot(hist, "Histogram", color = hist >= 0 ? color.green : color.red, style=plot.style_columns)
plot(macd, "MACD", color=color.blue)
plot(signal, "Signal", color=color.orange)
hline(0)
Use MFP Custom Script so it draws in its own pane.
Custom Scripts
Source: https://docs.myfundedperpetuals.com/guides/custom-scripts
− Write your own chart indicators in a Pine-style script language, with lines, colors, markers, background shading, and adjustable inputs.
+ Write your own chart indicators in the Custom Script language, a short Pine-style language with lines, colors, markers, background shading, and adjustable inputs.
Custom Scripts let you build your own indicators on the trade chart and the
trade journal chart. You write a short script, in a language modeled on
TradingView's Pine Script, and the chart draws the result on every candle.
There are two Custom Script indicators:
| Indicator | Where it draws |
|---|
| MFP Custom Script | Its own pane below the price chart, like RSI or MACD. |
| MFP Custom Script Overlay | On top of the candles, like a moving average. |
− [!NOTE]
− Custom Scripts are rolling out gradually. If you don't find them in the
− Indicators dialog, they aren't available on your account yet.
+ Scripts without a //@version line run on the Custom Script language
+ described here. On the trade chart, a script with a //@version line, such as
+ one copied from TradingView, runs as Pine Script instead, with more features
+ and higher limits: see Pine Scripts. The trade
+ journal chart runs every script in the Custom Script language.
Add a script
1. Open the chart and select Indicators.
2. Search for MFP and choose MFP Custom Script or **MFP Custom Script
Overlay**.
3. Open the indicator's settings from its row in the chart legend.
4. On the Inputs tab, replace the text in the Script box with your
script and select Ok.
Your script is saved with your chart layout, so it comes back when you
reload the page. You can add each indicator more than once to run several
scripts side by side.
Scripts run only in your browser, on the candles already loaded on your
chart. A script can read prices and draw on the chart. It can't place
orders, change settings, or read anything else about your account, so a
script someone shares with you can't act on your behalf.
Fix errors
If a script has a mistake, the indicator draws nothing and a notice appears
at the bottom of the chart. The notice gives the line and column of the
problem and, where it can, a suggestion:
Line 2, column 6: Unknown name "clsoe". Did you mean "close"?
The notice clears as soon as the script is valid. You can dismiss it with
the close button; it stays hidden until a different error appears or you
− reload the page.
+ reload the page. When there is more than one, the notice shows the most
+ important first and counts the rest: errors and notices for the same
+ script, then for other scripts on the chart.
Write a script
A script is a list of statements, one per line. You can also separate
statements with a semicolon. Text after // is a comment.
// Two moving averages
fast = ema(close, 9)
slow = ema(close, 21)
plot(fast, "Fast", color=color.blue)
plot(slow, "Slow", color=color.orange)
- Names. fast = ema(close, 9) gives a value a name you can reuse on
later lines. Each name can be set once, and a name can't reuse a built-in
value such as close or na.
- One-line scripts. A script that is a single expression, such as
condition was true; 1 is the one before that, up to 9.
- min, max, and avg take 2 to 10 values.
Limits
| Limit | Value |
|---|---|
| Script length | 4,000 characters |
| Lines (plot and hline) | 8 |
| Markers (plotshape) | 4 |
| Inputs | 8 |
| History reference (close[n]) | 5,000 candles |
| Length of any one function | 5,000 candles |
| All function lengths in one script, added up | 20,000 candles |
The last limit keeps a script from slowing down your chart. A script over
− any limit shows an error instead of running.
+ any limit shows an error instead of running. These limits apply to the Custom
+ Script language only; Pine scripts have their own, listed in
+ Pine Scripts.
Differences from Pine Script
− Many simple Pine Script indicators paste in with little or no change, and
− headers such as //@version=5 and indicator(...) are accepted. These parts
− of Pine Script aren't supported, and each shows an error explaining so:
+ The Custom Script language covers a small part of Pine Script. These parts of
+ Pine Script aren't supported in it, and each shows an error explaining so:
- if, for, while, and switch blocks. Use condition ? a : b.
- var, reassigning with :=, and your own functions.
- Lists, tuples such as [a, b] = ..., and text other than titles.
- Data from other markets or timeframes (request.security).
- Strategies, alerts, fill, plotchar, plotarrow, and drawing objects
such as labels, lines, boxes, and tables.
- offset= on plots, and input.string, input.color, and
input.timeframe.
plotshape accepts text= and size=, but markers are drawn without text,
at the chart's standard size. alertcondition is accepted and has no effect.
+ On the trade chart, add a //@version=6 line at the top of the script to run
+ it as Pine Script, which supports these features. See
+ Pine Scripts. The trade journal chart doesn't run Pine
+ Script, so a script that uses them shows an error there.
Examples
MACD
fastLen = input.int(12, "Fast")
slowLen = input.int(26, "Slow")
macd = ema(close, fastLen) - ema(close, slowLen)
signal = ema(macd, 9)
hist = macd - signal
plot(hist, "Histogram", color = hist >= 0 ? color.green : color.red, style=plot.style_columns)
plot(macd, "MACD", color=color.blue)
plot(signal, "Signal", color=color.orange)
hline(0)
Use MFP Custom Script so it draws in its own pane.