Main Settings

extern string ChannelID = "F5AC-11DB-BBA8"
CopyTool uses ChannelID to build virtual bridge between master side and slave side.
So ChannelID is unique string value through CopyTool instance.

Are you going to run another separate instance of CopyTool?
Read "How to install another instance of CopyTool" topic located in installation.html file.
extern int Timer.msec = 1000
Timer.msec param defines a frequency of main script loop in units of milliseconds.
Low values of the timer (0 - 500) can increase CPU usage with unsafe result. High values (10 000 - ...) can cause the slow processing of signals.
We recommend you to avoid modification of this param exept you are experienced user only.

Hint:
1000 milliseconds = 1 second.
extern bool MapSymbols = false
true: read MapSymbolsFile and process symbol-to-symbol mapping between master side and slave side.
false: trade symbols provided by master side without any mapping.
extern string MapSymbolsFile = "MapSymbols.txt"
MapSymbolsFile will help you to build symbol-to-symbol map in case master and slave terminals have different names of symbols.
There are 2 columns: source symbols for master side and destinition symbols for slave side.

Case A:
Let you have EURUSDm symbol on master side and EURUSD symbol on slave side.
Modify MapSymbolsFile, set MapSymbols = true.

MapSymbols.txt for the case A:
//---------------------------------
// Master => Slave
//---------------------------------
EURUSDm => EURUSD
[OTHER_SYMBOL]m => [OTHER_SYMBOL]
Case B:
Let master side has EURUSD symbol. Slave side has fxEURUSD symbol.
Modify MapSymbolsFile, set MapSymbols = true.

MapSymbols.txt for the case B:
//---------------------------------
// Master => Slave
//---------------------------------
EURUSD => fxEURUSD
[OTHER_SYMBOL] => fx[OTHER_SYMBOL]
Case C:
Master has EURUSD symbol. Slave has EURUSD symbol.
Set MapSymbols = false. There is no need to use MapSymbolsFile.

Lot Section

extern string _LotType_format1__ = "[MS: Master] [FX: fixed] [BP: balance pcnt]"
extern string _LotType_format2__ = "[EP: equity pcnt] [FMP: free margin pcnt]"
extern string _LotType_format3__ = "[MRT: martingale] [C: custom]"

extern string LotType = "MS"
LotType specifies the way of lot calculation on slave side.
Valid LotType values are "MS", "FX", "BP", "EP", "FMP", "MRT", "C".
extern double MS.LotRatio = 2.0
MS.LotRatio used in case LotType = "MS".
Slave lot calculated as master lot multiplied by MS.LotRatio.

Sample:
1) MasterLot = 0.1, MS.LotRatio = 1.0 => SlaveLot = 0.1*1.0 = 0.1

2) MasterLot = 1.0, MS.LotRatio = 2.0 => SlaveLot = 1.0*2.0 = 2.0

3) MasterLot = 6.0, MS.LotRatio = 0.5 => SlaveLot = 6.0*0.5 = 3.0
extern double FX.FixedLot = 0.1
FX.FixedLot used in case LotType = "FX".
Slave lot is equal to FX.FixedLot.
extern double BP.BalancePcnt = 10.0
extern double BP.BalanceBasis = 1000.0
BP.BalancePcnt and BP.BalanceBasis used in case LotType = "BP".
Slave lot calculated as AccountBalance()/BP.BalanceBasis * BP.BalancePcnt/100.

Sample:
1) BP.BalanceBasis = 1 000.0, BP.BalancePcnt = 10.0, current AccountBalance = 12 000.0
Lot = 12000.0/1000.0 * 10.0/100 = 1.2

2) BP.BalanceBasis = 500.0, BP.BalancePcnt = 5.0, current AccountBalance = 5 000.0
Lot = 5000.0/500.0 * 5.0/100 = 0.5
extern double EP.EquityPcnt = 15.0
extern double EP.EquityBasis = 1000.0
EP.EquityPcnt and EP.EquityBasis used in case LotType = "EP".
Slave lot calculated as AccountEquity()/EP.EquityBasis * EP.EquityPcnt/100.
extern double FMP.FreeMarginPcnt = 20.0
extern double FMP.FreeMarginBasis = 1000.0
FMP.FreeMarginPcnt and FMP.FreeMarginBasis used in case LotType = "FMP".
Slave lot calculated as AccountFreeMargin()/FMP.FreeMarginBasis * FMP.FreeMarginPcnt/100.
extern double MRT.LotRatio = 2.0
MRT.LotRatio used in case LotType = "MRT".
CopyTool will increase lots volume after every loss so that the first win would recover all previous losses plus win some profit.
Read more about martingale theory...

Sample:
FX.FixedLot = 0.1, MRT.LotRatio = 2.0

1) Buy EURUSD 0.1 closed by takeprofit => next lot = 0.1
2) Sell EURUSD 0.1 closed by stoploss => next lot = 0.1*2 = 0.2
3) Buy EURUSD 0.2 closed by stoploss => next lot = 0.2*2 = 0.4
4) Buy EURUSD 0.4 closed by stoploss => next lot = 0.4*2 = 0.8
5) Buy EURUSD 0.8 closed by takeprofit => next lot = 0.1
6) Sell EURUSD 0.1 closed by takeprofit => next lot = 0.1
...
extern double MinLot = 0.1
Minimum permitted amount of a lot.
extern double MaxLot = 5.0
Maximum permitted amount of a lot.
extern int LotDigits = 1
NormalizeDouble function rounds calculated lot value to the given precision.
Set LotDigits = 1 for standard accounts (minimum lot is 0.1)
Set LotDigits = 2 for mini accounts (minimum lot is 0.01)

Sample:
1) LotDigits = 0, calculated lot = 1.834, truncated lot = 1.0
2) LotDigits = 1, calculated lot = 5.237, truncated lot = 5.2
3) LotDigits = 1, calculated lot = 2.71, truncated lot = 2.7
4) LotDigits = 2, calculated lot = 0.392, truncated lot = 0.39
5) LotDigits = 2, calculated lot = 3.8734, truncated lot = 3.87

Trade Params

extern int AccDigits = 5
Set AccDigits = 4 if your broker provides 4-digit quotes.
Set AccDigits = 5 if your broker provides 5-digit quotes.

extern bool MarketExecution = false
true: two-steps open mode. (1) open new order without sl and tp. (2) add sl and/or tp.
false: standard one-step open mode.

There are 3 kinds of execution - Instant Execution, Request Execution and Market Execution.
Market execution forbids to set sl and tp with new order because open price is undefined.
Instead, a market order should be placed and then a take profit and/or stop loss added to the position.
extern string _CopyMode_format__ = "[A: absolute] [P: pips]"

extern string StopLossCopyMode = "A"
extern string TakeProfitCopyMode = "A"
"A": absolute mode. sl and tp values will be copied from master side as is.
"P": pips mode. sl and tp values will be adjusted. (1) absolute values transformed to pips, (2) pips applied to calculate new sl and tp on slave side.

Sample:
StopLossCopyMode = TakeProfitCopyMode = "A"

Let we have Master Buy order with open price = 1.2000, sl  = 1.1900, tp = 1.2100.
Let the open price on Slave terminal is 1.2010.

StopLoss and TakeProfit will be copied as is because copy mode ="A".
Master Buy => Slave Buy
open price 1.2000 => 1.2010
stop loss 1.1900 => 1.1900
take profit 1.2100 => 1.2100
Sample:
StopLossCopyMode = TakeProfitCopyMode = "P"

Let we have Master Buy order with open price = 1.2000, sl  = 1.1900, tp = 1.2100.
Let the open price on Slave terminal is 1.2010.

StopLoss and TakeProfit values will be transformed because copy mode ="P".
Master Buy => Slave Buy
open price 1.2000 => 1.2010
stop loss 1.1900 => 1.1910 (1.2010 - 100 pips)
take profit 1.2100 => 1.2110 (1.2010 + 100 pips)
extern tern bool OverwriteStopLoss = false
extern int NewStopLoss = 200
true: use NewStopLoss as stoploss of open orders.
false: ignore NewStopLoss, use stoploss from master side.
extern bool OverwriteTakeProfit = false
extern int NewTakeProfit = 200
true: use NewTakeProfit as takeprofit of open orders.
false: ignore NewTakeProfit, use takeprofit from master side.
extern bool OverwriteComment = false
extern string NewComment = ""
true: use NewComment as the comment of open orders.
false: ignore NewComment, use the comment from master side.
extern int RepeatN = 5
Slave terminal will repeat unsuccessful OrderSend, OrderModify, OrderClose, OrderDelete commands RepeatN times.
extern int Slippage = 3
Maximal allowed difference between the price on brokers side and the price requested by trader, pips.
Low values of Slippage will cause offten requotes.
High values can be the cause of disadvantageous open price.
2-5 is optimal range.

Filters

extern bool CheckMinMaxPriceDiff = true
true: check minimal and maximal price difference between open price on master side and market price on slave side.
false: ignore minimal and maximal price difference.
extern int MinPriceDiff.StopLossSide = 0
extern int MaxPriceDiff.StopLossSide = 1000
MinPriceDiff.StopLossSide and MaxPriceDiff.StopLossSide parameters define Buy zone for Buy orders and Sell zone for Sell orders in units of pips. Only StopLoss side of orders takes part in check.
CopyTool waits while orders are not in Buy/Sell zone. Buy or Sell performed once an order gets to allowed zone.
So this feature makes it possible to open an order at better price.
extern int MinPriceDiff.TakeProfitSide = 0
extern int MaxPriceDiff.TakeProfitSide = 1000
MinPriceDiff.TakeProfitSide and MaxPriceDiff.TakeProfitSide parameters define Buy zone for Buy orders and Sell zone for Sell orders in units of pips. Only TakeProfit side of orders is checked.
CopyTool waits while orders are not in Buy/Sell zone. Buy or Sell performed once an order gets to allowed zone.
So this feature makes it possible to open an order at better price.


extern bool CopyClose = true
Orders on slave side can be closed by Close command from master side, by StopLoss, by TakeProfit or manually.
true: copy Close operation from master side.
false: ignore Close operation from master side.

Logs

extern bool LogMasterTrades = false
Log information about open trades from master side.
extern bool LogMasterHistoryTrades = false
Log information about closed trades and cancelled orders from master side.
extern bool LogSymbolNotFound = true
If a copied symbol not found in the market watch window on slave terminal then a warning will be added to the log.
extern bool LogOrderAlreadyCopied = true
Log information in case an order already copied and closed but CopyTool trying to open this order second time.
extern bool LogMinMaxPriceDiff = true
Log information on MinMaxPriceDiff filter triggered.

Labels

extern int Timer.Corner = 1
extern int Timer.X = 20
extern int Timer.Y = 20
extern string Timer.FontName = "Arial Narrow"
extern int Timer.FontSize = 24
extern color Timer.FontColor = Gold
A corner, horizontal and vertical position, font name, font size and font color of Timer label object on MetaTrader chart window.
Valid corner values are 0, 1, 2 or 3.


extern int Error.Corner = 1
extern int Error.X = 20
extern int Error.Y = 60
extern string Error.FontName = "Arial Narrow"
extern int Error.FontSize = 18
extern color Error.FontColor = Red= Red
A corner, horizontal and vertical position, font name, font size and font color of Error label object on MetaTrader chart window.
Valid corner values are 0, 1, 2 or 3.
extern tern int About.Corner = 3
extern int About.X = 20
extern int About.Y = 15
extern int About.dY = 14
extern string About.FontName = "Verdana"
extern int About.FontSize = 9
extern color About.FontColor = Silver
A corner, horizontal and vertical position, distance between rows, font name, font size and font color of About label object on MetaTrader chart window.
Valid corner values are 0, 1, 2 or 3.

 

© 2005-2009 BJF Trading Group
http:// www.iticsoftware.com