Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
66 changes: 33 additions & 33 deletions Indicators/Account Sample/Account Sample/Account Sample.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand All @@ -16,7 +16,7 @@ public class AccountSample : Indicator
{
protected override void Initialize()
{
var grid = new Grid(16, 2)
var grid = new Grid(16, 2)
{
BackgroundColor = Color.Gold,
Opacity = 0.6,
Expand All @@ -31,173 +31,173 @@ protected override void Initialize()
style.Set(ControlProperty.FontWeight, FontWeight.ExtraBold);
style.Set(ControlProperty.BackgroundColor, Color.Black);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Account Info",
Style = style,
HorizontalAlignment = HorizontalAlignment.Center
}, 0, 0, 1, 2);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Type",
Style = style
}, 1, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.AccountType.ToString(),
Style = style
}, 1, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Is Live",
Style = style
}, 2, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.IsLive.ToString(),
Style = style
}, 2, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Balance",
Style = style
}, 3, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.Balance.ToString(),
Style = style
}, 3, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Broker Name",
Style = style
}, 4, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.BrokerName,
Style = style
}, 4, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Currency",
Style = style
}, 5, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.Asset.Name,
Style = style
}, 5, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Number",
Style = style
}, 6, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.Number.ToString(),
Style = style
}, 6, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Equity",
Style = style
}, 7, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.Equity.ToString(),
Style = style
}, 7, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Free Margin",
Style = style
}, 8, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.FreeMargin.ToString(),
Style = style
}, 8, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Margin",
Style = style
}, 9, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.Margin.ToString(),
Style = style
}, 9, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Margin Level",
Style = style
}, 10, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.MarginLevel.ToString(),
Style = style
}, 10, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Precise Leverage",
Style = style
}, 11, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.PreciseLeverage.ToString(),
Style = style
}, 11, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Stop Out Level",
Style = style
}, 12, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.StopOutLevel.ToString(),
Style = style
}, 12, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Unrealized Gross Profit",
Style = style
}, 13, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.UnrealizedGrossProfit.ToString(),
Style = style
}, 13, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Unrealized Net Profit",
Style = style
}, 14, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.UnrealizedNetProfit.ToString(),
Style = style
}, 14, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "User Id",
Style = style
}, 15, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Account.UserId.ToString(),
Style = style
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand All @@ -19,7 +19,7 @@ protected override void Initialize()
var text = string.Format("Account Type: {0}", Account.AccountType);

Chart.DrawStaticText("text", text, VerticalAlignment.Top, HorizontalAlignment.Right, Color.Red);

}

public override void Calculate(int index)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down Expand Up @@ -42,45 +42,45 @@ private void Application_ColorThemeChanged(ColorThemeChangeEventArgs obj)

private void DrawApplicationInfo()
{
var grid = new Grid(3, 2)
var grid = new Grid(3, 2)
{
BackgroundColor = Color.Goldenrod,
HorizontalAlignment = HorizontalAlignment,
VerticalAlignment = VerticalAlignment
};

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Version",
Margin = 5
}, 0, 0);
grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = Application.Version.ToString(),
Margin = 5
}, 0, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Theme",
Margin = 5
}, 1, 0);

_themeTextBlock = new TextBlock
_themeTextBlock = new TextBlock
{
Text = Application.ColorTheme.ToString(),
Margin = 5
};

grid.AddChild(_themeTextBlock, 1, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "User Time Offset",
Margin = 5
}, 2, 0);

_userTimeOffsetTextBlock = new TextBlock
_userTimeOffsetTextBlock = new TextBlock
{
Text = Application.UserTimeOffset.ToString(),
Margin = 5
Expand Down
2 changes: 1 addition & 1 deletion Indicators/Bar Sample/Bar Sample/Bar Sample.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
12 changes: 6 additions & 6 deletions Indicators/Bars Sample/Bars Sample/Bars Sample.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down Expand Up @@ -33,35 +33,35 @@ protected override void Initialize()

Bars.Reloaded += Bars_Reloaded;

var grid = new Grid(2, 2)
var grid = new Grid(2, 2)
{
BackgroundColor = Color.DarkGoldenrod,
HorizontalAlignment = HorizontalAlignment.Right,
VerticalAlignment = VerticalAlignment.Top,
Opacity = 0.5
};

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Bar Ticks #",
Margin = 5
}, 0, 0);

_barTicksNumberTextBlock = new TextBlock
_barTicksNumberTextBlock = new TextBlock
{
Text = "0",
Margin = 5
};

grid.AddChild(_barTicksNumberTextBlock, 0, 1);

grid.AddChild(new TextBlock
grid.AddChild(new TextBlock
{
Text = "Bars State",
Margin = 5
}, 1, 0);

_barsStateTextBlock = new TextBlock
_barsStateTextBlock = new TextBlock
{
Margin = 5
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// -------------------------------------------------------------------------------------------------
//
// This code is a cTrader Automate API example.
// This code is a cTrader Algo API example.
//
// This Indicator is intended to be used as a sample and does not guarantee any particular outcome or
// profit of any kind. Use it at your own risk.
Expand Down
Loading