4. Back to cTrader side.
*****
Below are the variable explanations at cTrader copier side:
1. 'Long Trade Switch' & 'Short Trade Switch' - switch variables for long or short trade.
2. Lot Mode - it has two options - 'fixed lot' or 'Follow Lot Info from TradingView'. default is fixed lot and can be set at 'Fixed Lot' variable. If selecting 'follow lot info' mode, please refer to lot info parsing rule at latter variable explanation.
3. Symbol Mapping List - this is to map the different symbol name between TradingView & cTrader. default will assume the signal symbol from TradingView is identical with cTrader's.
for instance
GOLD,XAUUSD;SILVER,XAGUSD;
TradingView symbol of GOLD alert will be mapped to cTrader's symbol of XAUUSD
each symbol uses ',' comma as seperator. First symbol is TradingView's while the second is cTrader's. each pair uses ';' semicolon as separator.
4. Close Trade By Oppposite Signal - default is 'yes'. this copier will follow TradingView's default netting/futures trading rules and thus close opposite short/long trades before placing a new long/short trade. if you don't like this rule, you could set this to 'no'.
5. Tp & SL in tick - default are both zero (i.e. disabled)
6. Below are for alert message parsing rules
Keywords for LONG or SHORT trade - this copier has listed some common keywords to identify an alert message as a LONG or SHORT signal. you could supplement your own by adding it with comma separation.
Excluded keywords from opening trade - NOT to open trade if those keywords are shown at messages.
Enable close trade keywords - enable keyword check to close trade.
Keywords to close LONG or SHORT trade - EA close trades for those keywords.
If you want to close all trades, set keywords list to 'Keywords to close both LONG & SHORT trades'.
If the close trade alerts from TradingView contain xx%, EA will follow the close ratio to partially close the applicable local trades, e.g. 'close long 50%'
Taking TP price from TradingView
default is off. If enabled, the copier bot will use the TP prices described at TradingView signal texts.
Taking SL price from TradingView
default is off. If enabled, the copier bot will use the SL prices described at TradingView signal texts.
* For instance, if the TP/SL price text format at TradingView signals is
BUY TP:1.06218, SL:1.03218
To parse this content, below variables should be set as
TP price head strings set as
TP:
SL price head string set as
SL:
'Close by Trade ID' feature
This is designed for trade exit needs of TradingView martingale strategy. Default is disabled.
1. At TradingView alert message, add trade ID identity at strategy.entry and strategy.exit comment (or alert_message) field.
e.g. trade entry:
LONG ID:LONG#1
LONG ID:LONG#2
trade exit
CLOSE LONG ID:LONG#1
CLOSE LONG ID:LONG#2
2. At cTrader copier side,
'Close trades by ID' ---> set to true to enable
'ID head string' ---> set ID: as head string to parse
'ID tail string' ---> leave blank to match above TradingView alert message example as it has no tail string
* Allowed symbol list from TradingView alerts
default is the blank string. it will take all symbol alerts from TradingView. if setting a string of allowed symbols, this copier bot will only accept the alert signals of those symbols. if symbol more than one, add comma in between, e.g. EURUSD,GBPUSD. but 'symbol mapping list' is required to set up if cTrader has different symbol name.
* How to set up and use lot info at TradingView alert
1. select 'Lot info from TradingView' at 'Lots mode' variable
2. set lot parsing texts at 'TradingView Lot Info Head String' & 'TradingView Lot Info Head String' variables
'TradingView Lot Info Head String' - default text is 'Lot:'
For instance
Buy Lot:2
Copier will use 2 lots to copy trade.
That is to precisely fetch the string before and after the lot number
3. TraidingView lot info to cTrader ratio
default is 1.0. if setting 0.1, 2 lot info from TradingView will be multiplied by 0.1. the result is 0.2 lot for copy trade.
=====
Special Note - Alternative approach to fetch TradingView alerts:
1. Default approach to get TradingView alerts is to fetch alert 'popup' at browser.
2. There is another alternative approach to fetch alert messages shown onTradingView 'log' panel - that is more reliable if your connection to TradingView server is not stable enough.
3. However, this alternative approach requires
- Keep TradingView alert 'log' panel always visible - like below:
- Cannot minimize that browser containing TradingView webpage
- TradingView webpage language has to be English
4. If you want to use this alternative approach to fetch TradingView alerts
- Add one below line under license_key=xxxx line at config.ini file
tvbridge2=on
- Save config.ini file
- Restart TVCopier app
5. When this copier app detects that TradingView alert 'log' panel is visible, it will show it's detected.
If TradingView alert log messages are empty initially, it will wait for 3 seconds to ensure it's indeed empty.