OPEN-SOURCE SCRIPT
已更新

Futures Margin Lookup Table

127
This script applies a table to the upper right corner of the screen, which provides the intraday and overnight margin requirements of the currently selected symbol.
In this indicator the user must provide the broker data in the form of specifically formatted text blocks. The data for which should be found on the broker website.

The purpose for it's creation is due to the non-standard way each individual broker may price their margins and lack of information within TradingView when connected to some (maybe all) brokers, including when paper trading, as the flat percentage rule is not accurate.

An example of information for NinjaTrader could look like this


MES;Micro S&P;$50;$2406
ES;E-Mini S&P;$500;$24,053
GC;Gold;$500;$16500
NQ;E-Mini Nasdaq;$1,000;$34,810
FDAX;Dax Index;€2,000;€44,311


Each symbol begins a new line, and the values on that line are separated by semicolons (;)
Each line consists of the following...
  • SYMBOL : Search string used to match to the beginning of the current chart symbol.
  • NAME: Human readable name
  • INTRA: Intraday trading margin requirement per contract
  • OVERNIGHT: Overnight trading margin requirement per contract


The script simply finds a matching line within your provided information using the current chart symbol.
So for example the continuous chart for
NQ1!
would match to the user specified line starting with NQ... as would the individual contract dates such as NQM2025, NQK2025, etc.

NOTES:
There is a possibility that symbols with similar starting characters could match.
If this is the case put the longer symbol higher in the list.
There is also a line / character limit to the text input fields within pinescript
Ensure the text you paste into them is not truncated.
If so there are 3 input fields for just this purpose.
Find the last complete line and continue the remaining symbol lines on the subsequent inputs.
發行說明
This script applies a table to your chart, which provides the intraday and overnight margin requirements of the currently selected symbol.
It has been updated to allow for custom colors, better table layout, and configurable position.
In this indicator the user must provide the broker data in the form of specifically formatted text blocks. The data for which should be found on the broker website.

The purpose for it's creation is due to the non-standard way each individual broker may price their margins and lack of information within TradingView when connected to some (maybe all) brokers, including when paper trading, as the flat percentage rule is not accurate.

An example of information for NinjaTrader could look like this


MES;Micro S&P;$50;$2406
ES;E-Mini S&P;$500;$24,053
GC;Gold;$500;$16500
NQ;E-Mini Nasdaq;$1,000;$34,810
FDAX;Dax Index;€2,000;€44,311


Each symbol begins a new line, and the values on that line are separated by semicolons (;)
Each line consists of the following...
  1. SYMBOL : Search string used to match to the beginning of the current chart symbol.
  2. NAME: Human readable name
  3. INTRA: Intraday trading margin requirement per contract
  4. OVERNIGHT: Overnight trading margin requirement per contract


The script simply finds a matching line within your provided information using the current chart symbol.
So for example the continuous chart for
NQ1!

would match to the user specified line starting with NQ... as would the individual contract dates such as NQM2025, NQK2025, etc.

NOTES:
There is a possibility that symbols with similar starting characters could match.
If this is the case put the longer symbol higher in the list.
There is also a line / character limit to the text input fields within pinescript
Ensure the text you paste into them is not truncated.
If so there are 3 input fields for just this purpose.
Find the last complete line and continue the remaining symbol lines on the subsequent inputs.
發行說明
Removed second loop break, as it was stopping some symbols from being found consistently.

免責聲明

這些資訊和出版物並不意味著也不構成TradingView提供或認可的金融、投資、交易或其他類型的意見或建議。請在使用條款閱讀更多資訊。