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.