Access account properties  [SOLVED]

Questions about MultiCharts .NET and user contributed studies.
Traderji
Posts: 41
Joined: 08 Mar 2012
Has thanked: 6 times
Been thanked: 17 times

Access account properties

Postby Traderji » 09 Aug 2012

Apologies for the newbie question but how to I get access to the properties of an account. This is what I have so far but it will not work.

Code: Select all

           

ITradingProfile myTradeProfile;
private string ProfileName = "My Broker Name";

protected override void StartCalc() {
  if (MBT == null) MBT = GetProfile(ProfileName);

  foreach (Account x in myTradeProfile)
  { 
         if (x.ID == "XXXXXXX") accountBal = x.Balance.ToString();
  }
}

protected TradeManager.ITradingProfile GetProfile(String Name)
{
     foreach (ITradingProfile p in TradeManager.TradingProfiles)
     {
        if (String.Equals(p.Name, Name)) return p;
     }
     return null;
}



User avatar
Dave Masalov
Posts: 1712
Joined: 16 Apr 2010
Has thanked: 51 times
Been thanked: 485 times

Re: Access account properties  [SOLVED]

Postby Dave Masalov » 10 Aug 2012

Hello Traderji,

Please see the attached code.
Attachments
GetAccountInfo.pln
(1.94 KiB) Downloaded 461 times
These users thanked the author Dave Masalov for the post:
JoshM

Traderji
Posts: 41
Joined: 08 Mar 2012
Has thanked: 6 times
Been thanked: 17 times

Re: Access account properties

Postby Traderji » 10 Aug 2012

Thanks Dave
These users thanked the author Traderji for the post:
radekj


Return to “MultiCharts .NET”