FXCM Contract Usage

Questions about MCFX and MCFX Data Feed.
Adam333
Posts: 20
Joined: 05 Oct 2010

FXCM Contract Usage

Postby Adam333 » 14 Oct 2010

When I place an order from within a MC strategy to buy "TradeSize" contracts (see code below) the trade sizes are ranging from 10-25 when Initial Capital = $100,000. TradeSize is being expressed in the base currency where as it appears the actual position being taken is in contracts. Does MC automatically convert a trade size from currency to contracts?

Code: Select all

inputs: ATRStop( 0 ), RiskPerTrade(0.03);
variables: ATR( 0 ), EquityAtRisk( 0 ), PointsAtRisk( 0 ), TradeSize( 0 );

//Caculate ATR for ATR trailing stop
ATR = AvgTrueRange( ATRLength );

//Calculate dollar amount of equity at risk
EquityAtRisk = RiskPerTrade * (InitialCapital + netprofit);

//Calculate points at risk
PointsAtRisk = absvalue( entryprice - (ATR * ATRStop) ) * bigpointvalue;

//Caculate position size
if PointsAtRisk = 0 then
TradeSize = 0
else
TradeSize = EquityAtRisk / PointsAtRisk;
Also, does my above usage of bigpointvalue look correct?

Thanks in advance,
Adam

bomberone1
Posts: 310
Joined: 02 Nov 2010
Has thanked: 26 times
Been thanked: 23 times

Re: FXCM Contract Usage

Postby bomberone1 » 24 Dec 2010

I think that the information is send from server of fxcm.

imoneyfish
Posts: 38
Joined: 26 Oct 2011
Has thanked: 6 times
Been thanked: 2 times

Re: FXCM Contract Usage

Postby imoneyfish » 28 Oct 2011

When I place an order from within a MC strategy to buy "TradeSize" contracts (see code below) the trade sizes are ranging from 10-25 when Initial Capital = $100,000. TradeSize is being expressed in the base currency where as it appears the actual position being taken is in contracts. Does MC automatically convert a trade size from currency to contracts?

Code: Select all

inputs: ATRStop( 0 ), RiskPerTrade(0.03);
variables: ATR( 0 ), EquityAtRisk( 0 ), PointsAtRisk( 0 ), TradeSize( 0 );

//Caculate ATR for ATR trailing stop
ATR = AvgTrueRange( ATRLength );

//Calculate dollar amount of equity at risk
EquityAtRisk = RiskPerTrade * (InitialCapital + netprofit);

//Calculate points at risk
PointsAtRisk = absvalue( entryprice - (ATR * ATRStop) ) * bigpointvalue;

//Caculate position size
if PointsAtRisk = 0 then
TradeSize = 0
else
TradeSize = EquityAtRisk / PointsAtRisk;
Also, does my above usage of bigpointvalue look correct?

Thanks in advance,
Adam

Different brokers use differnet settings? I am very confused in this area as well. It is very hard to calculate the position size right. Hope we can get some hint.

By the way, I tested your code, it didn't work, it still used the system value in the strategy properties.


Return to “MCFX”