if (Instrument.MasterInstrument.InstrumentType == InstrumentType.Forex) { if (String.Compare(Instrument.MasterInstrument.Name, 0, "USD", 0, 3) == 0) { m_pipCalcMode = 2; } else if (String.Compare(Instrument.MasterInstrument.Name, 3, "USD", 0, 3) == 0) { m_pipCalcMode = 1; m_pipValue = 10; } else { string tmp = Instrument.MasterInstrument.Name.Substring(3, 3); string FXPairName; if (tmp == "JPY" || tmp == "CHF" || tmp == "CAD") { FXPairName = "$" + "USD" + tmp; m_pipCalcMode = 4; } else { FXPairName = "$" + tmp + "USD"; m_pipCalcMode = 3; } Add(FXPairName, BarsPeriod.BarsPeriodType, BarsPeriod.Value); } }
Basically, this section is calculating the risk to determine the lot size depening upon the value of the stop loss compared to the account balance. So it has to calcualte the value of the stop loss based upon the underlyning pair and the quoting currency. So if it is not the quoting currency, then it must add it at this function.
-Stearno
Comment