Disclosure: I work on MetaRPC, which provides developer APIs and trade-copying software. The example below is a calculation exercise, not an investment recommendation. It does not connect to a broker or place an order.
A copier can receive a valid trade, calculate the intended follower volume correctly, and still get a rejection from the follower's broker. That is not necessarily a broken connection. The calculated volume may be outside the instrument's allowed range or volume step.
Here is a small example you can reproduce without credentials.
Start with the requested volume
Assume both accounts use the same deposit currency and the two instruments have the same contract size. The master balance is 10,000, the follower balance is 5,000, and the master opens 0.10 lots. With a balance multiplier of 1:
requested follower lots = master lots × follower balance / master balance × multiplier
= 0.10 × 5,000 / 10,000 × 1
= 0.05
This calculates volume. It does not establish equal financial risk. Stop distance, price, currency conversion, contract specifications and execution all matter. For a different contract or account currency, resolve those differences before using this simplified formula.
Validate before rounding
Suppose the follower instrument accepts a minimum of 0.10 lots. Our 0.05 request is too small. Rounding it up to 0.10 would double the intended volume. A generic rounding function should not silently make that decision.
This Python example deliberately rejects a volume that needs a policy decision. Use the follower broker's current symbol specifications for the limits; the values in the demo are illustrative.
from decimal import Decimal
def follower_lots(master_lots, master_balance, follower_balance,
multiplier, minimum, maximum, step):
# Pass decimal strings to avoid carrying binary float rounding into lots.
values = [Decimal(v) for v in (
master_lots, master_balance, follower_balance,
multiplier, minimum, maximum, step
)]
if any(not v.is_finite() or v <= 0 for v in values):
raise ValueError("Inputs must be finite and greater than zero")
lots, master, follower, factor, lower, upper, increment = values
if lower > upper:
raise ValueError("Minimum exceeds maximum")
requested = lots * follower / master * factor
if not lower <= requested <= upper:
raise ValueError(f"Requested {requested} lots is outside [{lower}, {upper}]")
# This example uses a volume grid consisting of multiples of the step.
if requested % increment != 0:
raise ValueError(f"Requested {requested} lots is not a multiple of {increment}")
return requested
print(follower_lots("0.10", "10000", "5000", "1", "0.01", "100", "0.01"))
# 0.05
Changing minimum to "0.10" raises an error. Changing the follower balance to "3333" produces 0.03333 lots, which fails a 0.01 step. Neither case is silently turned into a different position size.
Your production integration may offer an explicit rounding or minimum-lot policy. If it does, show the requested and adjusted volumes before enabling it, document the policy, and test it on demo accounts. Do not infer a broker's volume grid from the number of decimal places in its prices.
Keep calculation, request and fill separate
For each copied trade, keep three values in your diagnostic record:
- The requested follower volume from your sizing rule.
- The submitted volume after any explicitly configured normalization.
- The broker's accepted volume, ticket and response—or its rejection.
Also record the source trade identifier, mapped follower symbol and copier state. Avoid recording API keys or account passwords.
If an order request times out, read current orders and history before retrying. A timeout does not prove the broker rejected the order; repeating an uncertain request can create a duplicate.
Test the whole lifecycle on demo accounts
First use two demo accounts and the smallest volume that satisfies the follower's specifications. Open a master trade, confirm the follower's symbol and size, close the master trade, and confirm the follower closes too. Then test pause/resume separately and inspect the logs. A successful login alone does not prove copying works.
If you want to compare sizing rules without writing code, our free copier-sizing calculator shows the calculation inputs and result. The demo setup and troubleshooting guides cover the next steps. The calculator and tutorials are free; running connected terminals and copiers uses paid service credit.
For MetaRPC integrations, send the owner key in the ApiKey header on copier REST requests, including status and log reads. Keep any userKey or managerKey parameters required by the endpoint as well; they do not replace the header. Keep those credentials on your server.
Top comments (0)