OPEN-SOURCE SCRIPT
Coasyn Risk Gate

COASYN Risk Gate is a pre-trade risk checking tool for FX traders.
It does not generate entries, trade signals, or orders. The trader decides what they want to trade, then enters the planned trade information into Risk Gate before sizing the position.
The purpose is simple: check whether the proposed trade fits your own risk rules before you commit capital.
How to use it
Open the indicator settings and enter your planned trade information.
Choose LONG or SHORT, then enter your intended Entry Price and Stop Price.
Next, configure the risk limits you want Risk Gate to enforce:
Account Size — the account value used for the risk calculation.
Max Account Risk % — the maximum percentage of the account you are willing to risk on one trade.
Planned TradingView Risk % — the percentage you are currently planning to use when sizing the trade.
Minimum Reward R Required — the minimum reward-to-risk level you want displayed as an acceptable target.
Minimum / Maximum Stop Distance Pips — your acceptable stop-distance range.
ATR Stop Reality Gate — compares the proposed stop distance with current ATR so unusually tight or unusually wide stops can be flagged.
Min / Max Stop ATR — determines the acceptable stop-distance range relative to ATR.
Once the entry and stop are entered, Risk Gate calculates the proposed stop distance, ATR relationship, allowed account risk, planned monetary risk, and projected R levels.
Reading the panel
The top of the panel shows the current risk status.
RISK ACCEPTABLE means the trade currently passes the risk rules you configured.
Other messages explain why the trade has failed the precheck, including:
ENTRY REQUIRED — no entry price has been entered.
STOP REQUIRED — no stop price has been entered.
INVALID STOP — entry and stop are the same price.
STOP ON WRONG SIDE — a long trade has the stop above the entry, or a short trade has the stop below the entry.
RISK ABOVE LIMIT — the planned account risk exceeds your configured maximum.
STOP TOO WIDE / STOP TOO TIGHT — the proposed stop falls outside your pip-distance limits.
STOP WIDE VS ATR / STOP TIGHT VS ATR — the proposed stop falls outside your configured ATR-relative range.
At the bottom of the panel:
CAN SIZE means the setup has passed the configured risk gates.
DO NOT SIZE means one or more risk conditions still fail.
Chart levels
When Show Entry / Stop / R Lines is enabled, the indicator draws the proposed:
Entry
Stop
Minimum acceptable R target
directly on the chart.
These are planning references only. They do not place or modify orders.
The panel also displays the calculated 1R price, your configured minimum acceptable R price, and the 2R price.
Example workflow
You identify a trade setup independently.
You plan:
Direction → Entry → Stop
Enter those values into COASYN Risk Gate.
Risk Gate then checks the proposed trade against your configured risk limits.
If the panel returns CAN SIZE, you can move on to your normal position-sizing or order-entry process.
If it returns DO NOT SIZE, review the reason shown in the panel before proceeding.
Important
COASYN Risk Gate is a risk decision-support tool, not a trading system.
It does not determine whether a trade is good, predict market direction, calculate an automatic entry, or execute orders.
Your strategy determines whether you want the trade.
Risk Gate helps determine whether the proposed risk structure fits the rules you configured.
It does not generate entries, trade signals, or orders. The trader decides what they want to trade, then enters the planned trade information into Risk Gate before sizing the position.
The purpose is simple: check whether the proposed trade fits your own risk rules before you commit capital.
How to use it
Open the indicator settings and enter your planned trade information.
Choose LONG or SHORT, then enter your intended Entry Price and Stop Price.
Next, configure the risk limits you want Risk Gate to enforce:
Account Size — the account value used for the risk calculation.
Max Account Risk % — the maximum percentage of the account you are willing to risk on one trade.
Planned TradingView Risk % — the percentage you are currently planning to use when sizing the trade.
Minimum Reward R Required — the minimum reward-to-risk level you want displayed as an acceptable target.
Minimum / Maximum Stop Distance Pips — your acceptable stop-distance range.
ATR Stop Reality Gate — compares the proposed stop distance with current ATR so unusually tight or unusually wide stops can be flagged.
Min / Max Stop ATR — determines the acceptable stop-distance range relative to ATR.
Once the entry and stop are entered, Risk Gate calculates the proposed stop distance, ATR relationship, allowed account risk, planned monetary risk, and projected R levels.
Reading the panel
The top of the panel shows the current risk status.
RISK ACCEPTABLE means the trade currently passes the risk rules you configured.
Other messages explain why the trade has failed the precheck, including:
ENTRY REQUIRED — no entry price has been entered.
STOP REQUIRED — no stop price has been entered.
INVALID STOP — entry and stop are the same price.
STOP ON WRONG SIDE — a long trade has the stop above the entry, or a short trade has the stop below the entry.
RISK ABOVE LIMIT — the planned account risk exceeds your configured maximum.
STOP TOO WIDE / STOP TOO TIGHT — the proposed stop falls outside your pip-distance limits.
STOP WIDE VS ATR / STOP TIGHT VS ATR — the proposed stop falls outside your configured ATR-relative range.
At the bottom of the panel:
CAN SIZE means the setup has passed the configured risk gates.
DO NOT SIZE means one or more risk conditions still fail.
Chart levels
When Show Entry / Stop / R Lines is enabled, the indicator draws the proposed:
Entry
Stop
Minimum acceptable R target
directly on the chart.
These are planning references only. They do not place or modify orders.
The panel also displays the calculated 1R price, your configured minimum acceptable R price, and the 2R price.
Example workflow
You identify a trade setup independently.
You plan:
Direction → Entry → Stop
Enter those values into COASYN Risk Gate.
Risk Gate then checks the proposed trade against your configured risk limits.
If the panel returns CAN SIZE, you can move on to your normal position-sizing or order-entry process.
If it returns DO NOT SIZE, review the reason shown in the panel before proceeding.
Important
COASYN Risk Gate is a risk decision-support tool, not a trading system.
It does not determine whether a trade is good, predict market direction, calculate an automatic entry, or execute orders.
Your strategy determines whether you want the trade.
Risk Gate helps determine whether the proposed risk structure fits the rules you configured.
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。
開源腳本
秉持TradingView一貫精神,這個腳本的創作者將其設為開源,以便交易者檢視並驗證其功能。向作者致敬!您可以免費使用此腳本,但請注意,重新發佈代碼需遵守我們的社群規範。
免責聲明
這些資訊和出版物並非旨在提供,也不構成TradingView提供或認可的任何形式的財務、投資、交易或其他類型的建議或推薦。請閱讀使用條款以了解更多資訊。