From e3f91d691fd42c64b350b3ad808d29eebfa3351d Mon Sep 17 00:00:00 2001 From: evgenisedin Date: Wed, 12 Jun 2024 14:52:46 +0300 Subject: [PATCH 01/15] Add a new plugin example. --- Plugins/My ASP Example/My ASP Example/My ASP Example.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/My ASP Example/My ASP Example/My ASP Example.cs b/Plugins/My ASP Example/My ASP Example/My ASP Example.cs index 9d4128b..017c28a 100644 --- a/Plugins/My ASP Example/My ASP Example/My ASP Example.cs +++ b/Plugins/My ASP Example/My ASP Example/My ASP Example.cs @@ -2,7 +2,7 @@ // // This code is a cTrader Algo API example. // -// This code is intended to be used as a sample and does not guarantee any particular outcome or +// The code 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. // // This example plugin adds a new section to the Active Symbol Panel (ASP), with styles applied to the plugin controls. From 36c057a6ecfbd317954e7e157df9536b3425b55a Mon Sep 17 00:00:00 2001 From: evgenisedin Date: Thu, 13 Jun 2024 13:47:24 +0300 Subject: [PATCH 02/15] Add a plugin example from the video. --- Plugins/My ASP Example/My ASP Example/My ASP Example.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Plugins/My ASP Example/My ASP Example/My ASP Example.cs b/Plugins/My ASP Example/My ASP Example/My ASP Example.cs index 017c28a..77cf506 100644 --- a/Plugins/My ASP Example/My ASP Example/My ASP Example.cs +++ b/Plugins/My ASP Example/My ASP Example/My ASP Example.cs @@ -2,11 +2,12 @@ // // This code is a cTrader Algo API example. // -// The code 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. +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. // // This example plugin adds a new section to the Active Symbol Panel (ASP), with styles applied to the plugin controls. // +// For a detailed tutorial on creating this plugin, watch the video at: https://www.youtube.com/watch?v=WRwhT7jxTNs +// // ------------------------------------------------------------------------------------------------- using System; From 0995433c8052ad02f07a8a8981d0f1979d347087 Mon Sep 17 00:00:00 2001 From: evgenisedin Date: Thu, 13 Jun 2024 16:20:51 +0300 Subject: [PATCH 03/15] Add a plugin example from the video. --- Plugins/.samples.json | 3 + .../Previous Bar Info/Previous Bar Info.sln | 22 ++++ .../Previous Bar Info/Previous Bar Info.cs | 106 ++++++++++++++++++ .../Previous Bar Info.csproj | 9 ++ 4 files changed, 140 insertions(+) create mode 100644 Plugins/Previous Bar Info/Previous Bar Info.sln create mode 100644 Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.cs create mode 100644 Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.csproj diff --git a/Plugins/.samples.json b/Plugins/.samples.json index 4c047ec..5316ff8 100644 --- a/Plugins/.samples.json +++ b/Plugins/.samples.json @@ -47,6 +47,9 @@ { "name": "PositionCurrentPrice Sample" }, + { + "name": "Previous Bar Info" + }, { "name": "SmoothMouseMove Sample" }, diff --git a/Plugins/Previous Bar Info/Previous Bar Info.sln b/Plugins/Previous Bar Info/Previous Bar Info.sln new file mode 100644 index 0000000..86e5502 --- /dev/null +++ b/Plugins/Previous Bar Info/Previous Bar Info.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Previous Bar Info", "Previous Bar Info\Previous Bar Info.csproj", "{745f073c-3ae0-4138-a7ef-5f56c8c43c40}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {745f073c-3ae0-4138-a7ef-5f56c8c43c40}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {745f073c-3ae0-4138-a7ef-5f56c8c43c40}.Debug|Any CPU.Build.0 = Debug|Any CPU + {745f073c-3ae0-4138-a7ef-5f56c8c43c40}.Release|Any CPU.ActiveCfg = Release|Any CPU + {745f073c-3ae0-4138-a7ef-5f56c8c43c40}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.cs b/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.cs new file mode 100644 index 0000000..52d7806 --- /dev/null +++ b/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.cs @@ -0,0 +1,106 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example plugin adds a new section to Trade Watch, featuring a two-by-two grid that displays information about the last known bar prices. +// +// For a detailed tutorial on creating this plugin, watch the video at: https://youtu.be/0HB-rdwpMAY +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Plugins +{ + [Plugin(AccessRights = AccessRights.None)] + public class PreviousBarInfo : Plugin + { + + Bars _bars; + Grid _grid; + TextBlock _lowBlock; + TextBlock _openBlock; + TextBlock _highBlock; + TextBlock _closeBlock; + + protected override void OnStart() + { + var tradeWatchTab = TradeWatch.AddTab("Previous Bar Info"); + tradeWatchTab.IsSelected = true; + + var webView = new WebView(); + tradeWatchTab.Child = webView; + + webView.NavigateAsync("https://ctrader.com/"); + + _grid = new Grid(2, 2) + { + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + ShowGridLines = true, + Height = 150, + Width = 150, + }; + + _bars = MarketData.GetBars(TimeFrame.Minute, "USDJPY"); + + _lowBlock = new TextBlock + { + Text = "Low:" + _bars.LowPrices.LastValue, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + }; + + _highBlock = new TextBlock + { + Text = "High:" + _bars.HighPrices.LastValue, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + }; + + _closeBlock = new TextBlock + { + Text = "Close:" +_bars.ClosePrices.LastValue, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + }; + + _openBlock = new TextBlock + { + Text = "Open:" + _bars.OpenPrices.LastValue, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + }; + + _grid.AddChild(_lowBlock, 0, 0); + _grid.AddChild(_highBlock, 0, 1); + _grid.AddChild(_openBlock, 1, 0); + _grid.AddChild(_closeBlock, 1, 1); + + tradeWatchTab.Child = _grid; + + _bars.Tick += _bars_Tick; + + + } + + private void _bars_Tick(BarsTickEventArgs obj) + { + _lowBlock.Text = "Low: " +_bars.LowPrices.LastValue.ToString(); + _highBlock.Text = "High: " +_bars.HighPrices.LastValue.ToString(); + _openBlock.Text = "Open: " +_bars.OpenPrices.LastValue.ToString(); + _closeBlock.Text = "Close: " +_bars.ClosePrices.LastValue.ToString(); + } + + protected override void OnStop() + { + // Handle Plugin stop here + } + } +} \ No newline at end of file diff --git a/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.csproj b/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Plugins/Previous Bar Info/Previous Bar Info/Previous Bar Info.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From b0040e3474ab61f8cc4c2e39856e45c6a1208d66 Mon Sep 17 00:00:00 2001 From: Emmanuel Seriki Date: Wed, 19 Jun 2024 11:59:13 +0300 Subject: [PATCH 04/15] CNT-653--My-Custom-Frame-Example --- Plugins/.samples.json | 3 + .../My Custom Frame Example.sln | 22 +++++++ .../My Custom Frame Example.cs | 57 +++++++++++++++++++ .../My Custom Frame Example.csproj | 9 +++ 4 files changed, 91 insertions(+) create mode 100644 Plugins/My Custom Frame Example/My Custom Frame Example.sln create mode 100644 Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.cs create mode 100644 Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.csproj diff --git a/Plugins/.samples.json b/Plugins/.samples.json index 5316ff8..1204564 100644 --- a/Plugins/.samples.json +++ b/Plugins/.samples.json @@ -41,6 +41,9 @@ { "name": "My ASP Example" }, + { + "name": "My Custom Frame Example" + }, { "name": "Order by Margin" }, diff --git a/Plugins/My Custom Frame Example/My Custom Frame Example.sln b/Plugins/My Custom Frame Example/My Custom Frame Example.sln new file mode 100644 index 0000000..dd62670 --- /dev/null +++ b/Plugins/My Custom Frame Example/My Custom Frame Example.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "My Custom Frame Example", "My Custom Frame Example\My Custom Frame Example.csproj", "{bcac2c14-878a-4dff-aea7-df2f6d634f09}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {bcac2c14-878a-4dff-aea7-df2f6d634f09}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {bcac2c14-878a-4dff-aea7-df2f6d634f09}.Debug|Any CPU.Build.0 = Debug|Any CPU + {bcac2c14-878a-4dff-aea7-df2f6d634f09}.Release|Any CPU.ActiveCfg = Release|Any CPU + {bcac2c14-878a-4dff-aea7-df2f6d634f09}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.cs b/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.cs new file mode 100644 index 0000000..f0a6c2c --- /dev/null +++ b/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.cs @@ -0,0 +1,57 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example plugin adds two custom frames to the charts area, displaying two different websites. +// +// For a detailed tutorial on creating this plugin, watch the video at: [to:do] +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Plugins +{ + [Plugin(AccessRights = AccessRights.None)] + public class MyCustomFrameExample : Plugin + { + WebView _cTraderWebView = new WebView(); + WebView _cTraderWebViewSite = new WebView(); + + protected override void OnStart() + { + _cTraderWebView.Loaded += _cTraderWebView_Loaded; + var webViewFrame = ChartManager.AddCustomFrame("Forum"); + webViewFrame.Child = _cTraderWebView; + webViewFrame.ChartContainer.Mode = ChartMode.Multi; + webViewFrame.Attach(); + + _cTraderWebViewSite.Loaded += _cTraderWebViewSite_Loaded; + var webViewFrameSite = ChartManager.AddCustomFrame("Site"); + webViewFrameSite.Child = _cTraderWebViewSite; + webViewFrameSite.ChartContainer.Mode = ChartMode.Multi; + webViewFrameSite.Attach(); + } + + private void _cTraderWebView_Loaded(WebViewLoadedEventArgs args) + { + _cTraderWebView.NavigateAsync("https://www.ctrader.com/forum"); + } + + private void _cTraderWebViewSite_Loaded(WebViewLoadedEventArgs args) + { + _cTraderWebViewSite.NavigateAsync("https://www.spotware.com"); + } + + protected override void OnStop() + { + // Handle Plugin stop here + } + } +} \ No newline at end of file diff --git a/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.csproj b/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Plugins/My Custom Frame Example/My Custom Frame Example/My Custom Frame Example.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From 0529e10884818c5196dd6819882608b591cec285 Mon Sep 17 00:00:00 2001 From: Emmanuel Seriki Date: Wed, 19 Jun 2024 12:34:45 +0300 Subject: [PATCH 05/15] CNT-674--Custom-Window-Plugin --- Plugins/.samples.json | 3 + .../Custom Window Plugin.sln | 22 ++++++ .../Custom Window Plugin.cs | 67 +++++++++++++++++++ .../Custom Window Plugin.csproj | 9 +++ 4 files changed, 101 insertions(+) create mode 100644 Plugins/Custom Window Plugin/Custom Window Plugin.sln create mode 100644 Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs create mode 100644 Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.csproj diff --git a/Plugins/.samples.json b/Plugins/.samples.json index 5316ff8..0be45ac 100644 --- a/Plugins/.samples.json +++ b/Plugins/.samples.json @@ -32,6 +32,9 @@ { "name": "Custom Frame Sample" }, + { + "name": "Custom Window Plugin" + }, { "name": "IndicatorTitles Sample" }, diff --git a/Plugins/Custom Window Plugin/Custom Window Plugin.sln b/Plugins/Custom Window Plugin/Custom Window Plugin.sln new file mode 100644 index 0000000..32dca25 --- /dev/null +++ b/Plugins/Custom Window Plugin/Custom Window Plugin.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom Window Plugin", "Custom Window Plugin\Custom Window Plugin.csproj", "{65dfd7f6-65ba-4aed-bc96-051f978f3662}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {65dfd7f6-65ba-4aed-bc96-051f978f3662}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {65dfd7f6-65ba-4aed-bc96-051f978f3662}.Debug|Any CPU.Build.0 = Debug|Any CPU + {65dfd7f6-65ba-4aed-bc96-051f978f3662}.Release|Any CPU.ActiveCfg = Release|Any CPU + {65dfd7f6-65ba-4aed-bc96-051f978f3662}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs new file mode 100644 index 0000000..61b7ff5 --- /dev/null +++ b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example plugin adds a new custom window containing a "Add Take Profit" button, which adds Take Profit to open positions when clicked. +// +// For a detailed tutorial on creating this plugin, watch the video at: [to:do] +// +// ------------------------------------------------------------------------------------------------- + + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Plugins +{ + [Plugin(AccessRights = AccessRights.None)] + public class CustomWindowPlugin : Plugin + + { + private Button _buttonAddTakeProfit; + private Window _window; + + protected override void OnStart() + { + _buttonAddTakeProfit = new Button + { + BackgroundColor = Color.SeaGreen, + Height = 50, + Text = "Add Take Profit" + }; + + _buttonAddTakeProfit.Click += _buttonAddTakeProfit_Click; + + _window = new Window + { + Height = 150, + Width = 150, + Padding = new Thickness(5, 10, 10, 5) + }; + + _window.Child = _buttonAddTakeProfit; + _window.Show(); + } + + private void _buttonAddTakeProfit_Click(ButtonClickEventArgs args) + { + foreach (var position in Positions) + { + if (position.TakeProfit is null) + { + position.ModifyTakeProfitPips(20); + } + } + } + + protected override void OnStop() + { + // Handle Plugin stop here + } + } +} \ No newline at end of file diff --git a/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.csproj b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From e389a74f1a209777d6efb61c9578cfb6dcce7786 Mon Sep 17 00:00:00 2001 From: Emmanuel Seriki Date: Wed, 19 Jun 2024 12:54:50 +0300 Subject: [PATCH 06/15] CNT-677--Custom-Toolbar-Button-Sample --- Plugins/.samples.json | 3 + .../Custom Toolbar Button.sln | 22 ++++++ .../Custom Toolbar Button.cs | 75 +++++++++++++++++++ .../Custom Toolbar Button.csproj | 9 +++ 4 files changed, 109 insertions(+) create mode 100644 Plugins/Custom Toolbar Button/Custom Toolbar Button.sln create mode 100644 Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs create mode 100644 Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.csproj diff --git a/Plugins/.samples.json b/Plugins/.samples.json index 5316ff8..9d775d5 100644 --- a/Plugins/.samples.json +++ b/Plugins/.samples.json @@ -32,6 +32,9 @@ { "name": "Custom Frame Sample" }, + { + "name": "Custom Toolbar Button" + }, { "name": "IndicatorTitles Sample" }, diff --git a/Plugins/Custom Toolbar Button/Custom Toolbar Button.sln b/Plugins/Custom Toolbar Button/Custom Toolbar Button.sln new file mode 100644 index 0000000..3cfd9ad --- /dev/null +++ b/Plugins/Custom Toolbar Button/Custom Toolbar Button.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Custom Toolbar Button", "Custom Toolbar Button\Custom Toolbar Button.csproj", "{57aed799-0d95-49c7-ae8d-a8765b3052d6}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {57aed799-0d95-49c7-ae8d-a8765b3052d6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {57aed799-0d95-49c7-ae8d-a8765b3052d6}.Debug|Any CPU.Build.0 = Debug|Any CPU + {57aed799-0d95-49c7-ae8d-a8765b3052d6}.Release|Any CPU.ActiveCfg = Release|Any CPU + {57aed799-0d95-49c7-ae8d-a8765b3052d6}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs new file mode 100644 index 0000000..160a629 --- /dev/null +++ b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs @@ -0,0 +1,75 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example plugin adds a new button with a pop-up menu to the Chart Toolbar, featuring a "Close All Positions" button that closes open positions when clicked. +// +// For a detailed tutorial on creating this plugin, watch the video at: [to:do] +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Plugins +{ + [Plugin(AccessRights = AccessRights.None)] + public class CustomToolbarButton : Plugin + { + protected override void OnStart() + { + var icon = new SvgIcon(@""); + + var command = Commands.Add(CommandType.ChartContainerToolbar, OpenPositions, icon); + command.ToolTip = "Open Positions"; + + Commands.Add(CommandType.ChartContainerToolbar, CloseAllPositions, icon); + } + + private CommandResult CloseAllPositions (CommandArgs args) + { + var buttonStyle = new Style(); + + buttonStyle.Set(ControlProperty.Margin, new Thickness(0, 5, 0, 0)); + buttonStyle.Set(ControlProperty.Width, 150); + + var closePositionsButton = new Button + { + Text = "Close All Positions", + Style = buttonStyle + }; + + closePositionsButton.Click += args => + { + foreach (var position in Positions) + { + position.Close(); + } + }; + + var stackPanel = new StackPanel(); + stackPanel.AddChild(closePositionsButton); + + return new CommandResult(stackPanel); + } + + private void OpenPositions(CommandArgs args) + { + ExecuteMarketOrder(TradeType.Buy, "EURUSD", 1000); + ExecuteMarketOrder(TradeType.Buy, "USDJPY", 1000); + ExecuteMarketOrder(TradeType.Buy, "EURGBP", 1000); + } + + protected override void OnStop() + { + // Handle Plugin stop here + } + } +} \ No newline at end of file diff --git a/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.csproj b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From a4925e4562752ab74f452d5f425b41b4a8b7083e Mon Sep 17 00:00:00 2001 From: Emmanuel Seriki Date: Wed, 19 Jun 2024 16:13:09 +0300 Subject: [PATCH 07/15] CNT-674--Quotation-fix --- .../Custom Window Plugin/Custom Window Plugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs index 61b7ff5..dd45cba 100644 --- a/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs +++ b/Plugins/Custom Window Plugin/Custom Window Plugin/Custom Window Plugin.cs @@ -4,7 +4,7 @@ // // The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. // -// This example plugin adds a new custom window containing a "Add Take Profit" button, which adds Take Profit to open positions when clicked. +// This example plugin adds a new custom window containing a 'Add Take Profit' button, which adds Take Profit to open positions when clicked. // // For a detailed tutorial on creating this plugin, watch the video at: [to:do] // From 82d81de59796c8eb94fec92c70567fc72f797b13 Mon Sep 17 00:00:00 2001 From: Emmanuel Seriki Date: Wed, 19 Jun 2024 16:42:01 +0300 Subject: [PATCH 08/15] Fix quotation --- .../Custom Toolbar Button/Custom Toolbar Button.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs index 160a629..10e3116 100644 --- a/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs +++ b/Plugins/Custom Toolbar Button/Custom Toolbar Button/Custom Toolbar Button.cs @@ -4,7 +4,7 @@ // // The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. // -// This example plugin adds a new button with a pop-up menu to the Chart Toolbar, featuring a "Close All Positions" button that closes open positions when clicked. +// This example plugin adds a new button with a pop-up menu to the Chart Toolbar, featuring a 'Close All Positions' button that closes open positions when clicked. // // For a detailed tutorial on creating this plugin, watch the video at: [to:do] // From 0459e422400f11835b1de1bc9980aa7f7ee5ad78 Mon Sep 17 00:00:00 2001 From: Ahmad Noman Musleh Date: Thu, 4 Jul 2024 10:30:29 +0300 Subject: [PATCH 09/15] XT-15990 Rename Automate to Algo in all samples. Replace 'Automate' with 'Algo' in samples source code. --- .../Access Right Sample.cs | 2 +- .../Account Sample/Account Sample.cs | 66 +++---- .../AccountType Sample/AccountType Sample.cs | 4 +- .../Andrews Pitchfork Sample.cs | 2 +- .../Application Sample/Application Sample.cs | 16 +- .../Bar Sample/Bar Sample/Bar Sample.cs | 2 +- .../BarOpenedEventArgs Sample.cs | 2 +- .../Bars Sample/Bars Sample/Bars Sample.cs | 12 +- .../BarsTickEventArgs Sample.cs | 2 +- .../Bollinger Bands MTF Cloud Sample.cs | 2 +- .../Border Sample/Border Sample.cs | 12 +- .../Button Sample/Button Sample.cs | 6 +- .../ButtonClickEventArgs Sample.cs | 4 +- .../Canvas Sample/Canvas Sample.cs | 4 +- .../Character Casing Sample.cs | 16 +- .../Chart Color Settings Sample.cs | 18 +- .../Chart Display Settings Sample.cs | 16 +- .../Chart Ellipse Sample.cs | 2 +- .../Chart Icon Sample/Chart Icon Sample.cs | 2 +- .../Chart Keyboard Sample.cs | 14 +- .../Chart Rectangle Sample.cs | 2 +- .../Chart Sample/Chart Sample/Chart Sample.cs | 44 ++--- .../Chart Static Text Sample.cs | 2 +- .../Chart Text Sample/Chart Text Sample.cs | 2 +- .../Chart Trend Line Sample.cs | 2 +- .../Chart Triangle Sample.cs | 2 +- .../Chart Vertical Line Sample.cs | 2 +- .../ChartActivationChangedEventArgs Sample.cs | 2 +- .../ChartArea Sample/ChartArea Sample.cs | 2 +- .../ChartColorEventArgs Sample.cs | 2 +- .../ChartDisplaySettingsEventArgs Sample.cs | 2 +- .../ChartDragEventArgs Sample.cs | 2 +- .../ChartIconType Sample.cs | 2 +- .../ChartKeyboardEventArgs Sample.cs | 2 +- .../ChartMouseEventArgs Sample.cs | 2 +- .../ChartMouseWheelEventArgs Sample.cs | 2 +- ...ChartObjectHoverChangedEventArgs Sample.cs | 2 +- .../ChartObjectsAddedEventArgs Sample.cs | 2 +- .../ChartObjectsEventArgs Sample.cs | 2 +- .../ChartObjectsRemovedEventArgs Sample.cs | 2 +- ...ObjectsSelectionChangedEventArgs Sample.cs | 2 +- .../ChartObjectsUpdatedEventArgs Sample.cs | 2 +- .../ChartScrollEventArgs Sample.cs | 2 +- .../ChartSizeEventArgs Sample.cs | 2 +- .../ChartType Sample/ChartType Sample.cs | 2 +- .../ChartTypeEventArgs Sample.cs | 2 +- .../ChartZoomEventArgs Sample.cs | 2 +- .../CheckBox Control Sample.cs | 6 +- .../CheckBoxEventArgs Sample.cs | 4 +- .../Color Sample/Color Sample/Color Sample.cs | 2 +- .../Color Theme Sample/Color Theme Sample.cs | 2 +- .../ColorThemeChangeEventArgs Sample.cs | 2 +- .../Control Alignment Sample.cs | 4 +- .../ControlProperty Sample.cs | 4 +- .../Custom Control Sample.cs | 14 +- .../Data Series Sample/Data Series Sample.cs | 16 +- .../Dock Panel Sample/Dock Panel Sample.cs | 8 +- .../Ellipse Shape Sample.cs | 6 +- .../Equidistant Channel Sample.cs | 2 +- .../Fibonacci Expansion Sample.cs | 2 +- .../Fibonacci Fan Sample.cs | 2 +- .../Fibonacci Level Sample.cs | 2 +- .../Fibonacci Retracement Sample.cs | 2 +- .../Fill Rule Sample/Fill Rule Sample.cs | 16 +- .../Font Sample/Font Sample/Font Sample.cs | 20 +-- .../Functions Sample/Functions Sample.cs | 2 +- .../Grid Sample/Grid Sample/Grid Sample.cs | 166 +++++++++--------- .../GridColumn Sample/GridColumn Sample.cs | 6 +- .../GridLength Sample/GridLength Sample.cs | 6 +- .../GridRow Sample/GridRow Sample.cs | 6 +- .../GridUnitType Sample.cs | 6 +- .../HistoricalTrade Sample.cs | 30 ++-- .../HorizontalAlignment Sample.cs | 4 +- .../HorizontalLine Sample.cs | 2 +- .../IIndicatorsAccessor Sample.cs | 2 +- .../Image Sample/Image Sample/Image Sample.cs | 72 ++++---- .../Indicator Area Sample.cs | 8 +- .../Indicator Data Series Sample.cs | 2 +- .../IndicatorAreaAddedEventArgs Sample.cs | 2 +- .../IndicatorAreaEventArgs Sample.cs | 2 +- .../IndicatorAreaRemovedEventArgs Sample.cs | 2 +- .../Key Sample/Key Sample/Key Sample.cs | 2 +- .../Levels Sample/Levels Sample.cs | 2 +- .../Line Shape Sample/Line Shape Sample.cs | 4 +- .../Line Stacking Strategy Sample.cs | 8 +- .../Line Style Sample/Line Style Sample.cs | 2 +- .../Market Data Sample/Market Data Sample.cs | 4 +- .../Market Depth Ladder.cs | 2 +- .../Market Depth Sample.cs | 2 +- .../Market Snapshot Sample.cs | 32 ++-- .../MarketHours Sample/MarketHours Sample.cs | 26 +-- .../ModifierKeys Sample.cs | 2 +- .../Normalizing Volume Sample.cs | 2 +- .../Notifications Sample.cs | 2 +- .../Orientation Sample/Orientation Sample.cs | 12 +- .../Output Attribute Sample.cs | 2 +- .../Output Snapshot Sample.cs | 16 +- .../Parameter Attribute Sample.cs | 2 +- .../PenLineCap Sample/PenLineCap Sample.cs | 4 +- .../PenLineJoin Sample/PenLineJoin Sample.cs | 4 +- .../PlotType Sample/PlotType Sample.cs | 2 +- .../Polygon Sample/Polygon Sample.cs | 6 +- .../Polyline Sample/Polyline Sample.cs | 6 +- .../Radio Button Sample.cs | 8 +- .../RadioButtonEventArgs Sample.cs | 8 +- .../Rectangle Corner Radius Sample.cs | 4 +- .../Rectangle Shape Sample.cs | 6 +- .../ScrollBarVisibility Sample.cs | 10 +- .../ScrollViewer Sample.cs | 10 +- .../Server Sample/Server Sample.cs | 18 +- .../StackPanel Sample/StackPanel Sample.cs | 6 +- .../Stretch Sample/Stretch Sample.cs | 4 +- .../StretchDirection Sample.cs | 4 +- .../Style Sample/Style Sample/Style Sample.cs | 6 +- .../Symbol Sample/Symbol Sample.cs | 98 +++++------ .../SymbolInfo Sample/SymbolInfo Sample.cs | 78 ++++---- .../SymbolTickEventArgs Sample.cs | 2 +- .../Symbols Sample/Symbols Sample.cs | 10 +- .../TextAlignment Sample.cs | 6 +- .../TextBlock Sample/TextBlock Sample.cs | 6 +- .../TextBox Sample/TextBox Sample.cs | 6 +- .../TextChangedEventArgs Sample.cs | 6 +- .../TextTrimming Sample.cs | 6 +- .../TextWrapping Sample.cs | 6 +- .../Thickness Sample/Thickness Sample.cs | 6 +- .../Tick Sample/Tick Sample/Tick Sample.cs | 2 +- .../Ticks Sample/Ticks Sample/Ticks Sample.cs | 2 +- .../TicksHistoryLoadedEventArgs Sample.cs | 2 +- .../TicksTickEventArgs Sample.cs | 2 +- .../TimeFrame Sample/TimeFrame Sample.cs | 2 +- .../TimeSeries Sample/TimeSeries Sample.cs | 2 +- .../TimeZone Sample/TimeZone Sample.cs | 2 +- .../ToggleButtonEventArgs Sample.cs | 6 +- .../TradingSession Sample.cs | 26 +-- .../UserTimeOffsetChangedEventArgs Sample.cs | 2 +- .../VerticalAlignment Sample.cs | 4 +- .../Watchlist Sample/Watchlist Sample.cs | 2 +- .../WatchlistAddedEventArgs Sample.cs | 2 +- .../WatchlistRemovedEventArgs Sample.cs | 2 +- .../WatchlistRenamedEventArgs Sample.cs | 2 +- .../WatchlistSymbolAddedEventArgs Sample.cs | 2 +- .../WatchlistSymbolRemovedEventArgs Sample.cs | 2 +- .../Watchlists Sample/Watchlists Sample.cs | 2 +- .../WrapPanel Sample/WrapPanel Sample.cs | 6 +- .../ASP Section Example.cs | 10 +- .../All placements/All placements.cs | 88 +++++----- .../Interactive WebView.cs | 95 +++++----- .../Order by Margin/Order by Margin.cs | 78 ++++---- README.md | 4 +- .../Accelerator Oscillator Sample.cs | 2 +- .../Accumulative Swing Index Sample.cs | 6 +- .../Alligator Sample/Alligator Sample.cs | 2 +- .../Aroon Sample/Aroon Sample/Aroon Sample.cs | 2 +- ...irectional Movement Index Rating Sample.cs | 4 +- .../Average True Range Sample.cs | 2 +- .../Awesome Oscillator Sample.cs | 2 +- .../Bollinger Bands Sample.cs | 2 +- .../Center Of Gravity Sample.cs | 2 +- .../Chaikin Money Flow Sample.cs | 2 +- .../Chaikin Volatility Sample.cs | 2 +- .../Close All On Market Close Sample.cs | 2 +- .../Commodity Channel Index Sample.cs | 2 +- .../Custom Fitness Functions.cs | 4 +- .../Cyber Cycle Sample/Cyber Cycle Sample.cs | 2 +- .../Detrended Price Oscillator Sample.cs | 2 +- .../Directional Movement System Sample.cs | 2 +- .../Donchian Channel Sample.cs | 2 +- .../Ease Of Movement Sample.cs | 2 +- .../Error Sample/Error Sample/Error Sample.cs | 2 +- .../Exponential Moving Average Sample.cs | 10 +- .../Fractal Chaos Bands Sample.cs | 2 +- .../Fractals Sample/Fractals Sample.cs | 2 +- .../GetFitnessArgs Sample.cs | 2 +- Robots/Grid/Grid/Grid.cs | 48 ++--- .../High Minus Low Sample.cs | 4 +- .../Historical Volatility Sample.cs | 2 +- .../Hull Moving Average Sample.cs | 4 +- .../Ichimoku Kinko Hyo Sample.cs | 2 +- .../Keltner Channels Sample.cs | 2 +- .../Linear Regression Forecast Sample.cs | 2 +- .../Linear Regression Intercept Sample.cs | 2 +- .../Linear Regression R Squared Sample.cs | 2 +- .../Linear Regression Slope Sample.cs | 2 +- .../Macd Cross Over Sample.cs | 4 +- .../Macd Histogram Sample.cs | 2 +- .../Mass Index Sample/Mass Index Sample.cs | 2 +- .../Median Price Sample.cs | 2 +- .../Momentum Oscillator Sample.cs | 2 +- .../Money Flow Index Sample.cs | 2 +- .../Moving Average Sample.cs | 6 +- .../On Balance Volume Sample.cs | 2 +- .../Parabolic SAR Sample.cs | 2 +- .../Partial Close Sample.cs | 2 +- .../Pending Order Cancelation Sample.cs | 2 +- .../Pending Order Events.cs | 2 +- .../Pending Order Modification Sample.cs | 2 +- .../Pending Order Placing Sample.cs | 2 +- .../PendingOrderCancellationReason Sample.cs | 2 +- .../PendingOrders Sample.cs | 2 +- .../Polynomial Regression Channels Sample.cs | 2 +- .../Position Bars Passed Sample.cs | 2 +- .../Position Closing Sample.cs | 2 +- .../Position Events Sample.cs | 2 +- .../Position Execution Sample.cs | 2 +- .../Position Modification Sample.cs | 2 +- .../PositionCloseReason Sample.cs | 2 +- .../PositionModifiedEventArgs Sample.cs | 2 +- .../Price Oscillator Sample.cs | 2 +- .../Price ROC Sample/Price ROC Sample.cs | 2 +- .../Price Volume Trend Sample.cs | 2 +- .../Rainbow Oscillator Sample.cs | 2 +- .../Range Strategy Example.cs | 16 +- .../RefreshData Sample/RefreshData Sample.cs | 2 +- .../Relative Strength Index Sample.cs | 2 +- .../Running Mode Sample.cs | 2 +- .../Simple Moving Average Sample.cs | 4 +- .../Standard Deviation Sample.cs | 4 +- .../Stochastic Oscillator Sample.cs | 2 +- .../StopTriggerMethod Sample.cs | 2 +- .../Supertrend Sample/Supertrend Sample.cs | 2 +- .../Swing Index Sample/Swing Index Sample.cs | 4 +- .../Time Series Moving Average Sample.cs | 4 +- .../Timer Sample/Timer Sample/Timer Sample.cs | 2 +- .../Trade Volume Index Sample.cs | 2 +- .../TradeOperation Sample.cs | 2 +- .../TradeResult Sample/TradeResult Sample.cs | 2 +- .../TradeType Sample/TradeType Sample.cs | 2 +- .../Triangular Moving Average Sample.cs | 6 +- Robots/Trix Sample/Trix Sample/Trix Sample.cs | 2 +- .../True Range Sample/True Range Sample.cs | 2 +- .../Typical Price Sample.cs | 2 +- .../Ultimate Oscillator Sample.cs | 2 +- .../Vertical Horizontal Filter Sample.cs | 2 +- .../Vidya Sample/Vidya Sample/Vidya Sample.cs | 4 +- .../Volume Index Sample.cs | 2 +- .../Volume Oscillator Sample.cs | 2 +- .../Volume ROC Sample/Volume ROC Sample.cs | 2 +- .../Weighted Close Sample.cs | 2 +- .../Weighted Moving Average Sample.cs | 4 +- .../Welles Wilder Smoothing Sample.cs | 4 +- ...lliams Accumulation Distribution Sample.cs | 2 +- .../WilliamsPctR Sample.cs | 2 +- 242 files changed, 914 insertions(+), 913 deletions(-) diff --git a/Indicators/Access Right Sample/Access Right Sample/Access Right Sample.cs b/Indicators/Access Right Sample/Access Right Sample/Access Right Sample.cs index 85d36bb..093f645 100644 --- a/Indicators/Access Right Sample/Access Right Sample/Access Right Sample.cs +++ b/Indicators/Access Right Sample/Access Right Sample/Access Right Sample.cs @@ -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. diff --git a/Indicators/Account Sample/Account Sample/Account Sample.cs b/Indicators/Account Sample/Account Sample/Account Sample.cs index 75cc653..6e16a27 100644 --- a/Indicators/Account Sample/Account Sample/Account Sample.cs +++ b/Indicators/Account Sample/Account Sample/Account Sample.cs @@ -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. @@ -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, @@ -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 diff --git a/Indicators/AccountType Sample/AccountType Sample/AccountType Sample.cs b/Indicators/AccountType Sample/AccountType Sample/AccountType Sample.cs index fc4271d..0428472 100644 --- a/Indicators/AccountType Sample/AccountType Sample/AccountType Sample.cs +++ b/Indicators/AccountType Sample/AccountType Sample/AccountType Sample.cs @@ -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. @@ -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) diff --git a/Indicators/Andrews Pitchfork Sample/Andrews Pitchfork Sample/Andrews Pitchfork Sample.cs b/Indicators/Andrews Pitchfork Sample/Andrews Pitchfork Sample/Andrews Pitchfork Sample.cs index 67647f8..d4cad22 100644 --- a/Indicators/Andrews Pitchfork Sample/Andrews Pitchfork Sample/Andrews Pitchfork Sample.cs +++ b/Indicators/Andrews Pitchfork Sample/Andrews Pitchfork Sample/Andrews Pitchfork Sample.cs @@ -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. diff --git a/Indicators/Application Sample/Application Sample/Application Sample.cs b/Indicators/Application Sample/Application Sample/Application Sample.cs index c43f898..dbf18d6 100644 --- a/Indicators/Application Sample/Application Sample/Application Sample.cs +++ b/Indicators/Application Sample/Application Sample/Application Sample.cs @@ -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. @@ -42,31 +42,31 @@ 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 @@ -74,13 +74,13 @@ private void DrawApplicationInfo() 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 diff --git a/Indicators/Bar Sample/Bar Sample/Bar Sample.cs b/Indicators/Bar Sample/Bar Sample/Bar Sample.cs index 60c5a20..cb23e0b 100644 --- a/Indicators/Bar Sample/Bar Sample/Bar Sample.cs +++ b/Indicators/Bar Sample/Bar Sample/Bar Sample.cs @@ -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. diff --git a/Indicators/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample.cs b/Indicators/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample.cs index d978902..aeca432 100644 --- a/Indicators/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample.cs +++ b/Indicators/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample/BarOpenedEventArgs Sample.cs @@ -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. diff --git a/Indicators/Bars Sample/Bars Sample/Bars Sample.cs b/Indicators/Bars Sample/Bars Sample/Bars Sample.cs index 3e2f1e4..66ef464 100644 --- a/Indicators/Bars Sample/Bars Sample/Bars Sample.cs +++ b/Indicators/Bars Sample/Bars Sample/Bars Sample.cs @@ -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. @@ -33,7 +33,7 @@ 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, @@ -41,13 +41,13 @@ protected override void Initialize() 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 @@ -55,13 +55,13 @@ protected override void Initialize() 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 }; diff --git a/Indicators/BarsTickEventArgs Sample/BarsTickEventArgs Sample/BarsTickEventArgs Sample.cs b/Indicators/BarsTickEventArgs Sample/BarsTickEventArgs Sample/BarsTickEventArgs Sample.cs index d7afe53..c72b1a3 100644 --- a/Indicators/BarsTickEventArgs Sample/BarsTickEventArgs Sample/BarsTickEventArgs Sample.cs +++ b/Indicators/BarsTickEventArgs Sample/BarsTickEventArgs Sample/BarsTickEventArgs Sample.cs @@ -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. diff --git a/Indicators/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample.cs b/Indicators/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample.cs index 7e412a7..15c5d79 100644 --- a/Indicators/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample.cs +++ b/Indicators/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample/Bollinger Bands MTF Cloud Sample.cs @@ -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. diff --git a/Indicators/Border Sample/Border Sample/Border Sample.cs b/Indicators/Border Sample/Border Sample/Border Sample.cs index 709f611..2a5ed0f 100644 --- a/Indicators/Border Sample/Border Sample/Border Sample.cs +++ b/Indicators/Border Sample/Border Sample/Border Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class BorderSample : Indicator { protected override void Initialize() { - var border = new Border + var border = new Border { BorderColor = Color.Yellow, BorderThickness = 2, @@ -29,12 +29,12 @@ protected override void Initialize() Margin = 10 }; - var stackPanel = new StackPanel + var stackPanel = new StackPanel { Orientation = Orientation.Vertical }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Text", Margin = 5, @@ -42,7 +42,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - stackPanel.AddChild(new Button + stackPanel.AddChild(new Button { Text = "Button", Margin = 5, @@ -50,7 +50,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - stackPanel.AddChild(new TextBox + stackPanel.AddChild(new TextBox { Text = "Type text...", Margin = 5, diff --git a/Indicators/Button Sample/Button Sample/Button Sample.cs b/Indicators/Button Sample/Button Sample/Button Sample.cs index fb255da..a27020e 100644 --- a/Indicators/Button Sample/Button Sample/Button Sample.cs +++ b/Indicators/Button Sample/Button Sample/Button Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class ButtonSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -28,7 +28,7 @@ protected override void Initialize() for (int i = 0; i < 5; i++) { - var button = new Button + var button = new Button { Text = "Button #" + i, Margin = 10 diff --git a/Indicators/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample.cs b/Indicators/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample.cs index 9b90698..c9557a9 100644 --- a/Indicators/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample.cs +++ b/Indicators/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample/ButtonClickEventArgs Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class ButtonClickEventArgsSample : Indicator { protected override void Initialize() { - var button = new Button + var button = new Button { Text = "Button not clicked yet", HorizontalAlignment = HorizontalAlignment.Center, diff --git a/Indicators/Canvas Sample/Canvas Sample/Canvas Sample.cs b/Indicators/Canvas Sample/Canvas Sample/Canvas Sample.cs index 556fce7..9580c0b 100644 --- a/Indicators/Canvas Sample/Canvas Sample/Canvas Sample.cs +++ b/Indicators/Canvas Sample/Canvas Sample/Canvas Sample.cs @@ -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. diff --git a/Indicators/Character Casing Sample/Character Casing Sample/Character Casing Sample.cs b/Indicators/Character Casing Sample/Character Casing Sample/Character Casing Sample.cs index 7b695e7..c2a6e48 100644 --- a/Indicators/Character Casing Sample/Character Casing Sample/Character Casing Sample.cs +++ b/Indicators/Character Casing Sample/Character Casing Sample/Character Casing Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class CharacterCasingSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -25,7 +25,7 @@ protected override void Initialize() Width = 200 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Lower Character Casing", Margin = new Thickness(10, 10, 10, 0), @@ -33,13 +33,13 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - stackPanel.AddChild(new TextBox + stackPanel.AddChild(new TextBox { CharacterCasing = CharacterCasing.Lower, Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Upper Character Casing", Margin = new Thickness(10, 10, 10, 0), @@ -47,13 +47,13 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - stackPanel.AddChild(new TextBox + stackPanel.AddChild(new TextBox { CharacterCasing = CharacterCasing.Upper, Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Normal Character Casing", Margin = new Thickness(10, 10, 10, 0), @@ -61,7 +61,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - stackPanel.AddChild(new TextBox + stackPanel.AddChild(new TextBox { CharacterCasing = CharacterCasing.Normal, Margin = 10 diff --git a/Indicators/Chart Color Settings Sample/Chart Color Settings Sample/Chart Color Settings Sample.cs b/Indicators/Chart Color Settings Sample/Chart Color Settings Sample/Chart Color Settings Sample.cs index c730baa..55c8ec8 100644 --- a/Indicators/Chart Color Settings Sample/Chart Color Settings Sample/Chart Color Settings Sample.cs +++ b/Indicators/Chart Color Settings Sample/Chart Color Settings Sample/Chart Color Settings Sample.cs @@ -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. @@ -22,7 +22,7 @@ public class ChartColorSettingsSample : Indicator protected override void Initialize() { - var grid = new Grid(10, 2) + var grid = new Grid(10, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -37,13 +37,13 @@ protected override void Initialize() style.Set(ControlProperty.ForegroundColor, Color.Red); style.Set(ControlProperty.MinWidth, 100); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Ask Price Line Color", Style = style }, 0, 0); - _askPriceLineColorTextBox = new TextBox + _askPriceLineColorTextBox = new TextBox { Text = Chart.ColorSettings.AskPriceLineColor.ToString(), Style = style @@ -51,13 +51,13 @@ protected override void Initialize() grid.AddChild(_askPriceLineColorTextBox, 0, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Bid Price Line Color", Style = style }, 1, 0); - _bidPriceLineColorTextBox = new TextBox + _bidPriceLineColorTextBox = new TextBox { Text = Chart.ColorSettings.BidPriceLineColor.ToString(), Style = style @@ -65,13 +65,13 @@ protected override void Initialize() grid.AddChild(_bidPriceLineColorTextBox, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Background Color", Style = style }, 2, 0); - _backgroundColorTextBox = new TextBox + _backgroundColorTextBox = new TextBox { Text = Chart.ColorSettings.BackgroundColor.ToString(), Style = style @@ -79,7 +79,7 @@ protected override void Initialize() grid.AddChild(_backgroundColorTextBox, 2, 1); - var changeButton = new Button + var changeButton = new Button { Text = "Change", Style = style diff --git a/Indicators/Chart Display Settings Sample/Chart Display Settings Sample/Chart Display Settings Sample.cs b/Indicators/Chart Display Settings Sample/Chart Display Settings Sample/Chart Display Settings Sample.cs index 31fde95..a90f293 100644 --- a/Indicators/Chart Display Settings Sample/Chart Display Settings Sample/Chart Display Settings Sample.cs +++ b/Indicators/Chart Display Settings Sample/Chart Display Settings Sample/Chart Display Settings Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class ChartDisplaySettingsSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Left, VerticalAlignment = VerticalAlignment.Bottom, @@ -26,7 +26,7 @@ protected override void Initialize() Orientation = Orientation.Vertical }; - var askPriceLineCheckBox = new CheckBox + var askPriceLineCheckBox = new CheckBox { Text = "Ask Price Line", Margin = 5, @@ -37,7 +37,7 @@ protected override void Initialize() stackPanel.AddChild(askPriceLineCheckBox); - var bidPriceLineCheckBox = new CheckBox + var bidPriceLineCheckBox = new CheckBox { Text = "Bid Price Line", Margin = 5, @@ -48,7 +48,7 @@ protected override void Initialize() stackPanel.AddChild(bidPriceLineCheckBox); - var chartScaleCheckBox = new CheckBox + var chartScaleCheckBox = new CheckBox { Text = "Chart Scale", Margin = 5, @@ -59,7 +59,7 @@ protected override void Initialize() stackPanel.AddChild(chartScaleCheckBox); - var dealMapCheckBox = new CheckBox + var dealMapCheckBox = new CheckBox { Text = "Deal Map", Margin = 5, @@ -70,7 +70,7 @@ protected override void Initialize() stackPanel.AddChild(dealMapCheckBox); - var gridCheckBox = new CheckBox + var gridCheckBox = new CheckBox { Text = "Grid", Margin = 5, @@ -81,7 +81,7 @@ protected override void Initialize() stackPanel.AddChild(gridCheckBox); - var volumeCheckBox = new CheckBox + var volumeCheckBox = new CheckBox { Text = "Volume", Margin = 5, diff --git a/Indicators/Chart Ellipse Sample/Chart Ellipse Sample/Chart Ellipse Sample.cs b/Indicators/Chart Ellipse Sample/Chart Ellipse Sample/Chart Ellipse Sample.cs index 4e579e9..1795419 100644 --- a/Indicators/Chart Ellipse Sample/Chart Ellipse Sample/Chart Ellipse Sample.cs +++ b/Indicators/Chart Ellipse Sample/Chart Ellipse Sample/Chart Ellipse Sample.cs @@ -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. diff --git a/Indicators/Chart Icon Sample/Chart Icon Sample/Chart Icon Sample.cs b/Indicators/Chart Icon Sample/Chart Icon Sample/Chart Icon Sample.cs index 3a8a6c9..96e7cb3 100644 --- a/Indicators/Chart Icon Sample/Chart Icon Sample/Chart Icon Sample.cs +++ b/Indicators/Chart Icon Sample/Chart Icon Sample/Chart Icon Sample.cs @@ -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. diff --git a/Indicators/Chart Keyboard Sample/Chart Keyboard Sample/Chart Keyboard Sample.cs b/Indicators/Chart Keyboard Sample/Chart Keyboard Sample/Chart Keyboard Sample.cs index 758f2c7..84a226b 100644 --- a/Indicators/Chart Keyboard Sample/Chart Keyboard Sample/Chart Keyboard Sample.cs +++ b/Indicators/Chart Keyboard Sample/Chart Keyboard Sample/Chart Keyboard Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class ChartKeyboardSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { Orientation = Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, @@ -28,7 +28,7 @@ protected override void Initialize() Width = 200 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Keyboard Handler", FontWeight = FontWeight.ExtraBold, @@ -39,14 +39,14 @@ protected override void Initialize() var grid = new Grid(2, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Key Down", Margin = 5, ForegroundColor = Color.Black }, 0, 0); - _keyDownTextBlock = new TextBlock + _keyDownTextBlock = new TextBlock { Margin = 5, ForegroundColor = Color.Black @@ -54,14 +54,14 @@ protected override void Initialize() grid.AddChild(_keyDownTextBlock, 0, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Key Combination", Margin = 5, ForegroundColor = Color.Black }, 1, 0); - _keyCombinationTextBlock = new TextBlock + _keyCombinationTextBlock = new TextBlock { Margin = 5, ForegroundColor = Color.Black diff --git a/Indicators/Chart Rectangle Sample/Chart Rectangle Sample/Chart Rectangle Sample.cs b/Indicators/Chart Rectangle Sample/Chart Rectangle Sample/Chart Rectangle Sample.cs index 7629fcc..cdf0afc 100644 --- a/Indicators/Chart Rectangle Sample/Chart Rectangle Sample/Chart Rectangle Sample.cs +++ b/Indicators/Chart Rectangle Sample/Chart Rectangle Sample/Chart Rectangle Sample.cs @@ -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. diff --git a/Indicators/Chart Sample/Chart Sample/Chart Sample.cs b/Indicators/Chart Sample/Chart Sample/Chart Sample.cs index bae3caa..844b311 100644 --- a/Indicators/Chart Sample/Chart Sample/Chart Sample.cs +++ b/Indicators/Chart Sample/Chart Sample/Chart Sample.cs @@ -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. @@ -71,7 +71,7 @@ private void CreateAndAddGridToChart() if (_grid != null) Chart.RemoveControl(_grid); - _grid = new Grid(10, 2) + _grid = new Grid(10, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -85,46 +85,46 @@ private void CreateAndAddGridToChart() style.Set(ControlProperty.FontWeight, FontWeight.ExtraBold); style.Set(ControlProperty.ForegroundColor, Color.Red); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Height", Style = style }, 0, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.Height.ToString(), Style = style }, 0, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Width", Style = style }, 1, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.Width.ToString(), Style = style }, 1, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Zoom Level", Style = style }, 2, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.ZoomLevel.ToString(), Style = style }, 2, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Objects #", Style = style }, 3, 0); - _objectsNumberTextBlock = new TextBlock + _objectsNumberTextBlock = new TextBlock { Style = style, Text = Chart.Objects.Count.ToString() @@ -132,46 +132,46 @@ private void CreateAndAddGridToChart() _grid.AddChild(_objectsNumberTextBlock, 3, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Top Y", Style = style }, 4, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.TopY.ToString(), Style = style }, 4, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Bottom Y", Style = style }, 5, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.BottomY.ToString(), Style = style }, 5, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Type", Style = style }, 6, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.ChartType.ToString(), Style = style }, 6, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Mouse Location", Style = style }, 7, 0); - _mouseLocationTextBlock = new TextBlock + _mouseLocationTextBlock = new TextBlock { Style = style, Text = "(Null, Null)" @@ -179,24 +179,24 @@ private void CreateAndAddGridToChart() _grid.AddChild(_mouseLocationTextBlock, 7, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Indicator Areas #", Style = style }, 8, 0); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = Chart.IndicatorAreas.Count.ToString(), Style = style }, 8, 1); - _grid.AddChild(new TextBlock + _grid.AddChild(new TextBlock { Text = "Mouse Wheel Delta", Style = style }, 9, 0); - _mouseWheelDeltaTextBlock = new TextBlock + _mouseWheelDeltaTextBlock = new TextBlock { Style = style, Text = "0" diff --git a/Indicators/Chart Static Text Sample/Chart Static Text Sample/Chart Static Text Sample.cs b/Indicators/Chart Static Text Sample/Chart Static Text Sample/Chart Static Text Sample.cs index 1cd3e82..57d9caa 100644 --- a/Indicators/Chart Static Text Sample/Chart Static Text Sample/Chart Static Text Sample.cs +++ b/Indicators/Chart Static Text Sample/Chart Static Text Sample/Chart Static Text Sample.cs @@ -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. diff --git a/Indicators/Chart Text Sample/Chart Text Sample/Chart Text Sample.cs b/Indicators/Chart Text Sample/Chart Text Sample/Chart Text Sample.cs index bfcf377..bd8cf57 100644 --- a/Indicators/Chart Text Sample/Chart Text Sample/Chart Text Sample.cs +++ b/Indicators/Chart Text Sample/Chart Text Sample/Chart Text Sample.cs @@ -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. diff --git a/Indicators/Chart Trend Line Sample/Chart Trend Line Sample/Chart Trend Line Sample.cs b/Indicators/Chart Trend Line Sample/Chart Trend Line Sample/Chart Trend Line Sample.cs index 4781a83..e9d25b4 100644 --- a/Indicators/Chart Trend Line Sample/Chart Trend Line Sample/Chart Trend Line Sample.cs +++ b/Indicators/Chart Trend Line Sample/Chart Trend Line Sample/Chart Trend Line Sample.cs @@ -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. diff --git a/Indicators/Chart Triangle Sample/Chart Triangle Sample/Chart Triangle Sample.cs b/Indicators/Chart Triangle Sample/Chart Triangle Sample/Chart Triangle Sample.cs index 256a851..4546000 100644 --- a/Indicators/Chart Triangle Sample/Chart Triangle Sample/Chart Triangle Sample.cs +++ b/Indicators/Chart Triangle Sample/Chart Triangle Sample/Chart Triangle Sample.cs @@ -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. diff --git a/Indicators/Chart Vertical Line Sample/Chart Vertical Line Sample/Chart Vertical Line Sample.cs b/Indicators/Chart Vertical Line Sample/Chart Vertical Line Sample/Chart Vertical Line Sample.cs index a8302ba..6084e83 100644 --- a/Indicators/Chart Vertical Line Sample/Chart Vertical Line Sample/Chart Vertical Line Sample.cs +++ b/Indicators/Chart Vertical Line Sample/Chart Vertical Line Sample/Chart Vertical Line Sample.cs @@ -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. diff --git a/Indicators/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample.cs b/Indicators/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample.cs index 66f470a..8367d25 100644 --- a/Indicators/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample.cs +++ b/Indicators/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample/ChartActivationChangedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartArea Sample/ChartArea Sample/ChartArea Sample.cs b/Indicators/ChartArea Sample/ChartArea Sample/ChartArea Sample.cs index e4ba911..807fda4 100644 --- a/Indicators/ChartArea Sample/ChartArea Sample/ChartArea Sample.cs +++ b/Indicators/ChartArea Sample/ChartArea Sample/ChartArea Sample.cs @@ -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. diff --git a/Indicators/ChartColorEventArgs Sample/ChartColorEventArgs Sample/ChartColorEventArgs Sample.cs b/Indicators/ChartColorEventArgs Sample/ChartColorEventArgs Sample/ChartColorEventArgs Sample.cs index 091dbf8..03ff69a 100644 --- a/Indicators/ChartColorEventArgs Sample/ChartColorEventArgs Sample/ChartColorEventArgs Sample.cs +++ b/Indicators/ChartColorEventArgs Sample/ChartColorEventArgs Sample/ChartColorEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample.cs b/Indicators/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample.cs index 9547461..41ae935 100644 --- a/Indicators/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample.cs +++ b/Indicators/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample/ChartDisplaySettingsEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartDragEventArgs Sample/ChartDragEventArgs Sample/ChartDragEventArgs Sample.cs b/Indicators/ChartDragEventArgs Sample/ChartDragEventArgs Sample/ChartDragEventArgs Sample.cs index 2edc867..46b1b54 100644 --- a/Indicators/ChartDragEventArgs Sample/ChartDragEventArgs Sample/ChartDragEventArgs Sample.cs +++ b/Indicators/ChartDragEventArgs Sample/ChartDragEventArgs Sample/ChartDragEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartIconType Sample/ChartIconType Sample/ChartIconType Sample.cs b/Indicators/ChartIconType Sample/ChartIconType Sample/ChartIconType Sample.cs index 267d858..f08f2f3 100644 --- a/Indicators/ChartIconType Sample/ChartIconType Sample/ChartIconType Sample.cs +++ b/Indicators/ChartIconType Sample/ChartIconType Sample/ChartIconType Sample.cs @@ -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. diff --git a/Indicators/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample.cs b/Indicators/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample.cs index da273ba..75b5663 100644 --- a/Indicators/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample.cs +++ b/Indicators/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample/ChartKeyboardEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample.cs b/Indicators/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample.cs index 22be36c..c5de20a 100644 --- a/Indicators/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample.cs +++ b/Indicators/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample/ChartMouseEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample.cs b/Indicators/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample.cs index ef98298..f4af248 100644 --- a/Indicators/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample.cs +++ b/Indicators/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample/ChartMouseWheelEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample.cs b/Indicators/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample.cs index 77e45e8..ed458e9 100644 --- a/Indicators/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample.cs +++ b/Indicators/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample/ChartObjectHoverChangedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample.cs b/Indicators/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample.cs index a3b9a9c..8f66607 100644 --- a/Indicators/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample.cs +++ b/Indicators/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample/ChartObjectsAddedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample.cs b/Indicators/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample.cs index b3b058f..4f86b74 100644 --- a/Indicators/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample.cs +++ b/Indicators/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample/ChartObjectsEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample.cs b/Indicators/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample.cs index 9e613a3..654948a 100644 --- a/Indicators/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample.cs +++ b/Indicators/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample/ChartObjectsRemovedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample.cs b/Indicators/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample.cs index 62aa9ee..35cd524 100644 --- a/Indicators/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample.cs +++ b/Indicators/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample/ChartObjectsSelectionChangedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample.cs b/Indicators/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample.cs index 46f7739..4ce9347 100644 --- a/Indicators/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample.cs +++ b/Indicators/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample/ChartObjectsUpdatedEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample.cs b/Indicators/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample.cs index 79dbf6f..8c5491c 100644 --- a/Indicators/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample.cs +++ b/Indicators/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample/ChartScrollEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample.cs b/Indicators/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample.cs index d830a1c..c62a1dc 100644 --- a/Indicators/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample.cs +++ b/Indicators/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample/ChartSizeEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartType Sample/ChartType Sample/ChartType Sample.cs b/Indicators/ChartType Sample/ChartType Sample/ChartType Sample.cs index 7fb87ef..cbe1bdf 100644 --- a/Indicators/ChartType Sample/ChartType Sample/ChartType Sample.cs +++ b/Indicators/ChartType Sample/ChartType Sample/ChartType Sample.cs @@ -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. diff --git a/Indicators/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample.cs b/Indicators/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample.cs index 24721db..6412fcf 100644 --- a/Indicators/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample.cs +++ b/Indicators/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample/ChartTypeEventArgs Sample.cs @@ -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. diff --git a/Indicators/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample.cs b/Indicators/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample.cs index 0d0da3b..479eb5f 100644 --- a/Indicators/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample.cs +++ b/Indicators/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample/ChartZoomEventArgs Sample.cs @@ -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. diff --git a/Indicators/CheckBox Control Sample/CheckBox Control Sample/CheckBox Control Sample.cs b/Indicators/CheckBox Control Sample/CheckBox Control Sample/CheckBox Control Sample.cs index f6d4d1f..77f0607 100644 --- a/Indicators/CheckBox Control Sample/CheckBox Control Sample/CheckBox Control Sample.cs +++ b/Indicators/CheckBox Control Sample/CheckBox Control Sample/CheckBox Control Sample.cs @@ -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. @@ -16,14 +16,14 @@ public class CheckBoxControlSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, BackgroundColor = Color.Gold }; - var checkBox = new CheckBox + var checkBox = new CheckBox { Text = "Unchecked", Margin = 10, diff --git a/Indicators/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample.cs b/Indicators/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample.cs index 4213d30..e763ae7 100644 --- a/Indicators/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample.cs +++ b/Indicators/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample/CheckBoxEventArgs Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class CheckBoxEventArgsSample : Indicator { protected override void Initialize() { - var checkBox = new CheckBox + var checkBox = new CheckBox { Text = "Check Box", HorizontalAlignment = HorizontalAlignment.Center, diff --git a/Indicators/Color Sample/Color Sample/Color Sample.cs b/Indicators/Color Sample/Color Sample/Color Sample.cs index 3144e71..ddd01aa 100644 --- a/Indicators/Color Sample/Color Sample/Color Sample.cs +++ b/Indicators/Color Sample/Color Sample/Color Sample.cs @@ -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. diff --git a/Indicators/Color Theme Sample/Color Theme Sample/Color Theme Sample.cs b/Indicators/Color Theme Sample/Color Theme Sample/Color Theme Sample.cs index 2903dd7..2d448c5 100644 --- a/Indicators/Color Theme Sample/Color Theme Sample/Color Theme Sample.cs +++ b/Indicators/Color Theme Sample/Color Theme Sample/Color Theme Sample.cs @@ -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. diff --git a/Indicators/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample.cs b/Indicators/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample.cs index fa2f147..54e3015 100644 --- a/Indicators/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample.cs +++ b/Indicators/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample/ColorThemeChangeEventArgs Sample.cs @@ -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. diff --git a/Indicators/Control Alignment Sample/Control Alignment Sample/Control Alignment Sample.cs b/Indicators/Control Alignment Sample/Control Alignment Sample/Control Alignment Sample.cs index 5f1d720..2bdab8b 100644 --- a/Indicators/Control Alignment Sample/Control Alignment Sample/Control Alignment Sample.cs +++ b/Indicators/Control Alignment Sample/Control Alignment Sample/Control Alignment Sample.cs @@ -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. @@ -22,7 +22,7 @@ public class ControlAlignmentSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment, VerticalAlignment = VerticalAlignment, diff --git a/Indicators/ControlProperty Sample/ControlProperty Sample/ControlProperty Sample.cs b/Indicators/ControlProperty Sample/ControlProperty Sample/ControlProperty Sample.cs index e1526a2..23b8cb7 100644 --- a/Indicators/ControlProperty Sample/ControlProperty Sample/ControlProperty Sample.cs +++ b/Indicators/ControlProperty Sample/ControlProperty Sample/ControlProperty Sample.cs @@ -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. @@ -23,7 +23,7 @@ protected override void Initialize() style.Set(ControlProperty.FontSize, 14); style.Set(ControlProperty.Width, 100); - var textBlock = new TextBlock + var textBlock = new TextBlock { Text = "Styled Text Block", Style = style, diff --git a/Indicators/Custom Control Sample/Custom Control Sample/Custom Control Sample.cs b/Indicators/Custom Control Sample/Custom Control Sample/Custom Control Sample.cs index bb43c3c..0e84172 100644 --- a/Indicators/Custom Control Sample/Custom Control Sample/Custom Control Sample.cs +++ b/Indicators/Custom Control Sample/Custom Control Sample/Custom Control Sample.cs @@ -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. @@ -17,7 +17,7 @@ public class CustomControlSample : Indicator { protected override void Initialize() { - var comboBox = new ComboBox + var comboBox = new ComboBox { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center @@ -55,21 +55,21 @@ public class ComboBox : CustomControl public ComboBox() { - _textBox = new TextBox + _textBox = new TextBox { Width = 100, IsReadOnly = true, IsReadOnlyCaretVisible = false }; - _button = new Button + _button = new Button { Text = "▼" }; _button.Click += Button_Click; - var stackPanel = new StackPanel + var stackPanel = new StackPanel { Orientation = Orientation.Horizontal }; @@ -77,7 +77,7 @@ public ComboBox() stackPanel.AddChild(_textBox); stackPanel.AddChild(_button); - _panel = new StackPanel + _panel = new StackPanel { Orientation = Orientation.Vertical }; @@ -117,7 +117,7 @@ private void Button_Click(ButtonClickEventArgs obj) { var item = _items[i]; - _itemsGrid.AddChild(new TextBlock + _itemsGrid.AddChild(new TextBlock { Text = item.ToString() }, i, 0); diff --git a/Indicators/Data Series Sample/Data Series Sample/Data Series Sample.cs b/Indicators/Data Series Sample/Data Series Sample/Data Series Sample.cs index 29fe1e2..b7efec8 100644 --- a/Indicators/Data Series Sample/Data Series Sample/Data Series Sample.cs +++ b/Indicators/Data Series Sample/Data Series Sample/Data Series Sample.cs @@ -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. @@ -23,7 +23,7 @@ public class DataSeriesSample : Indicator protected override void Initialize() { - var grid = new Grid(3, 2) + var grid = new Grid(3, 2) { BackgroundColor = Color.DarkGoldenrod, HorizontalAlignment = HorizontalAlignment.Left, @@ -31,13 +31,13 @@ protected override void Initialize() Opacity = 0.5 }; - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Last Value", Margin = 5 }, 0, 0); - _lastValueTextBlock = new TextBlock + _lastValueTextBlock = new TextBlock { Text = Source.LastValue.ToString(), Margin = 5 @@ -45,13 +45,13 @@ protected override void Initialize() grid.AddChild(_lastValueTextBlock, 0, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Last Closed Value", Margin = 5 }, 1, 0); - _lastClosedValueTextBlock = new TextBlock + _lastClosedValueTextBlock = new TextBlock { Text = Source.Last(1).ToString(), Margin = 5 @@ -59,13 +59,13 @@ protected override void Initialize() grid.AddChild(_lastClosedValueTextBlock, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Values Count", Margin = 5 }, 2, 0); - _countTextBlock = new TextBlock + _countTextBlock = new TextBlock { Text = Source.Count.ToString(), Margin = 5 diff --git a/Indicators/Dock Panel Sample/Dock Panel Sample/Dock Panel Sample.cs b/Indicators/Dock Panel Sample/Dock Panel Sample/Dock Panel Sample.cs index 929ade8..e9ef6ca 100644 --- a/Indicators/Dock Panel Sample/Dock Panel Sample/Dock Panel Sample.cs +++ b/Indicators/Dock Panel Sample/Dock Panel Sample/Dock Panel Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class DockPanelSample : Indicator { protected override void Initialize() { - var dockPanel = new DockPanel + var dockPanel = new DockPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.8 }; - dockPanel.AddChild(new TextBlock + dockPanel.AddChild(new TextBlock { Text = "Enter Your Name", Margin = 5, @@ -34,7 +34,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }); - dockPanel.AddChild(new TextBox + dockPanel.AddChild(new TextBox { Dock = Dock.Bottom, Margin = 5, diff --git a/Indicators/Ellipse Shape Sample/Ellipse Shape Sample/Ellipse Shape Sample.cs b/Indicators/Ellipse Shape Sample/Ellipse Shape Sample/Ellipse Shape Sample.cs index c56b480..1ec97fd 100644 --- a/Indicators/Ellipse Shape Sample/Ellipse Shape Sample/Ellipse Shape Sample.cs +++ b/Indicators/Ellipse Shape Sample/Ellipse Shape Sample/Ellipse Shape Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class EllipseShapeSample : Indicator { protected override void Initialize() { - var ellipse = new Ellipse + var ellipse = new Ellipse { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -31,7 +31,7 @@ protected override void Initialize() Top = 50 }; - var canvas = new Canvas + var canvas = new Canvas { BackgroundColor = Color.Gold, Opacity = 0.5 diff --git a/Indicators/Equidistant Channel Sample/Equidistant Channel Sample/Equidistant Channel Sample.cs b/Indicators/Equidistant Channel Sample/Equidistant Channel Sample/Equidistant Channel Sample.cs index ba4ef0d..ba63aa4 100644 --- a/Indicators/Equidistant Channel Sample/Equidistant Channel Sample/Equidistant Channel Sample.cs +++ b/Indicators/Equidistant Channel Sample/Equidistant Channel Sample/Equidistant Channel Sample.cs @@ -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. diff --git a/Indicators/Fibonacci Expansion Sample/Fibonacci Expansion Sample/Fibonacci Expansion Sample.cs b/Indicators/Fibonacci Expansion Sample/Fibonacci Expansion Sample/Fibonacci Expansion Sample.cs index 852e183..bb9eea8 100644 --- a/Indicators/Fibonacci Expansion Sample/Fibonacci Expansion Sample/Fibonacci Expansion Sample.cs +++ b/Indicators/Fibonacci Expansion Sample/Fibonacci Expansion Sample/Fibonacci Expansion Sample.cs @@ -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. diff --git a/Indicators/Fibonacci Fan Sample/Fibonacci Fan Sample/Fibonacci Fan Sample.cs b/Indicators/Fibonacci Fan Sample/Fibonacci Fan Sample/Fibonacci Fan Sample.cs index 8e3cf31..b3cab2b 100644 --- a/Indicators/Fibonacci Fan Sample/Fibonacci Fan Sample/Fibonacci Fan Sample.cs +++ b/Indicators/Fibonacci Fan Sample/Fibonacci Fan Sample/Fibonacci Fan Sample.cs @@ -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. diff --git a/Indicators/Fibonacci Level Sample/Fibonacci Level Sample/Fibonacci Level Sample.cs b/Indicators/Fibonacci Level Sample/Fibonacci Level Sample/Fibonacci Level Sample.cs index 6f06535..bb8b249 100644 --- a/Indicators/Fibonacci Level Sample/Fibonacci Level Sample/Fibonacci Level Sample.cs +++ b/Indicators/Fibonacci Level Sample/Fibonacci Level Sample/Fibonacci Level Sample.cs @@ -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. diff --git a/Indicators/Fibonacci Retracement Sample/Fibonacci Retracement Sample/Fibonacci Retracement Sample.cs b/Indicators/Fibonacci Retracement Sample/Fibonacci Retracement Sample/Fibonacci Retracement Sample.cs index f06111f..7430d3e 100644 --- a/Indicators/Fibonacci Retracement Sample/Fibonacci Retracement Sample/Fibonacci Retracement Sample.cs +++ b/Indicators/Fibonacci Retracement Sample/Fibonacci Retracement Sample/Fibonacci Retracement Sample.cs @@ -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. diff --git a/Indicators/Fill Rule Sample/Fill Rule Sample/Fill Rule Sample.cs b/Indicators/Fill Rule Sample/Fill Rule Sample/Fill Rule Sample.cs index e8d63e4..97ced0a 100644 --- a/Indicators/Fill Rule Sample/Fill Rule Sample/Fill Rule Sample.cs +++ b/Indicators/Fill Rule Sample/Fill Rule Sample/Fill Rule Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class FillRuleSample : Indicator { protected override void Initialize() { - var stackPanelNonzero = new StackPanel + var stackPanelNonzero = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - stackPanelNonzero.AddChild(new TextBlock + stackPanelNonzero.AddChild(new TextBlock { Text = "Nonzero", ForegroundColor = Color.Black, @@ -32,14 +32,14 @@ protected override void Initialize() Margin = 10 }); - stackPanelNonzero.AddChild(new Polygon + stackPanelNonzero.AddChild(new Polygon { FillColor = Color.Red, Width = 200, Height = 100, FillRule = FillRule.Nonzero, Margin = 10, - Points = new Point[] + Points = new Point[] { new Point(1, 200), new Point(50, 30), @@ -52,7 +52,7 @@ protected override void Initialize() } }); - stackPanelNonzero.AddChild(new TextBlock + stackPanelNonzero.AddChild(new TextBlock { Text = "EvenOdd", ForegroundColor = Color.Black, @@ -60,14 +60,14 @@ protected override void Initialize() Margin = 10 }); - stackPanelNonzero.AddChild(new Polygon + stackPanelNonzero.AddChild(new Polygon { FillColor = Color.Red, Width = 200, Height = 100, FillRule = FillRule.EvenOdd, Margin = 10, - Points = new Point[] + Points = new Point[] { new Point(1, 200), new Point(50, 30), diff --git a/Indicators/Font Sample/Font Sample/Font Sample.cs b/Indicators/Font Sample/Font Sample/Font Sample.cs index 47aaf47..e748d75 100644 --- a/Indicators/Font Sample/Font Sample/Font Sample.cs +++ b/Indicators/Font Sample/Font Sample/Font Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class FontSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Thin Weight Size 10 FontStyle Normal Font Default", FontSize = 10, @@ -34,7 +34,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Thin Weight Size 10 FontStyle Italic Font Default", FontSize = 10, @@ -44,7 +44,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Thin Weight Size 10 FontStyle Oblique Font Default", FontSize = 10, @@ -54,7 +54,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Black Weight Size 10 FontStyle Normal Font Default", FontSize = 10, @@ -64,7 +64,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Bold Weight Size 10 FontStyle Normal Font Default", FontSize = 10, @@ -74,7 +74,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Heavy Weight Size 10 FontStyle Normal Font Default", FontSize = 10, @@ -84,7 +84,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Bold Weight Size 12 FontStyle Normal Font Default", FontSize = 12, @@ -94,7 +94,7 @@ protected override void Initialize() Margin = 10 }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Thin Weight Size 12 FontStyle Normal Font Calibri Light Italic", FontSize = 12, diff --git a/Indicators/Functions Sample/Functions Sample/Functions Sample.cs b/Indicators/Functions Sample/Functions Sample/Functions Sample.cs index bab2f0a..f705882 100644 --- a/Indicators/Functions Sample/Functions Sample/Functions Sample.cs +++ b/Indicators/Functions Sample/Functions Sample/Functions Sample.cs @@ -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. diff --git a/Indicators/Grid Sample/Grid Sample/Grid Sample.cs b/Indicators/Grid Sample/Grid Sample/Grid Sample.cs index 36fd8a7..650f5c2 100644 --- a/Indicators/Grid Sample/Grid Sample/Grid Sample.cs +++ b/Indicators/Grid Sample/Grid Sample/Grid Sample.cs @@ -1,91 +1,91 @@ // ------------------------------------------------------------------------------------------------- // -// 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. // // ------------------------------------------------------------------------------------------------- - using cAlgo.API; - namespace cAlgo - { - [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] - public class GridSample : Indicator - { - [Parameter("Grid Rows #", DefaultValue = 10)] - public int GridRowsNumber { get; set; } - [Parameter("Grid Columns #", DefaultValue = 2)] - public int GridColumnsNumber { get; set; } - [Parameter("Grid Row Length", DefaultValue = 2)] - public int GridRowLength { get; set; } - [Parameter("Grid Row Length Unit Type", DefaultValue = GridUnitType.Auto)] - public GridUnitType GridRowLengthUnitType { get; set; } - [Parameter("Grid Column Length", DefaultValue = 2)] - public int GridColumnLength { get; set; } - [Parameter("Grid Column Length Unit Type", DefaultValue = GridUnitType.Auto)] - public GridUnitType GridColumnLengthUnitType { get; set; } - protected override void Initialize() - { - var grid = new Grid(GridRowsNumber, GridColumnsNumber) - { - BackgroundColor = Color.Gold, - Opacity = 0.6, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center, - ShowGridLines = true, - }; - for (int iRow = 0; iRow < GridRowsNumber; iRow++) - { - var row = grid.Rows[iRow]; - SetGridRowLength(row); - for (int iColumn = 0; iColumn < GridColumnsNumber; iColumn++) - { - var column = grid.Columns[iColumn]; - SetGridColumnLength(column); - grid.AddChild(new TextBlock - { - Text = string.Format("Row {0} and Column {1}", iRow, iColumn), - Margin = 5, - ForegroundColor = Color.Black, - FontWeight = FontWeight.ExtraBold - }, iRow, iColumn); - } - } - Chart.AddControl(grid); - } - private void SetGridRowLength(GridRow row) - { - switch (GridRowLengthUnitType) - { - case GridUnitType.Auto: - row.SetHeightToAuto(); - break; - case GridUnitType.Pixel: - row.SetHeightInPixels(GridRowLength); - break; - case GridUnitType.Star: - row.SetHeightInStars(GridRowLength); - break; - } - } - private void SetGridColumnLength(GridColumn column) - { - switch (GridColumnLengthUnitType) - { - case GridUnitType.Auto: - column.SetWidthToAuto(); - break; - case GridUnitType.Pixel: - column.SetWidthInPixels(GridColumnLength); - break; - case GridUnitType.Star: - column.SetWidthInStars(GridColumnLength); - break; - } - } - public override void Calculate(int index) - { - } - } - } +using cAlgo.API; +namespace cAlgo +{ + [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] + public class GridSample : Indicator + { + [Parameter("Grid Rows #", DefaultValue = 10)] + public int GridRowsNumber { get; set; } + [Parameter("Grid Columns #", DefaultValue = 2)] + public int GridColumnsNumber { get; set; } + [Parameter("Grid Row Length", DefaultValue = 2)] + public int GridRowLength { get; set; } + [Parameter("Grid Row Length Unit Type", DefaultValue = GridUnitType.Auto)] + public GridUnitType GridRowLengthUnitType { get; set; } + [Parameter("Grid Column Length", DefaultValue = 2)] + public int GridColumnLength { get; set; } + [Parameter("Grid Column Length Unit Type", DefaultValue = GridUnitType.Auto)] + public GridUnitType GridColumnLengthUnitType { get; set; } + protected override void Initialize() + { + var grid = new Grid(GridRowsNumber, GridColumnsNumber) + { + BackgroundColor = Color.Gold, + Opacity = 0.6, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center, + ShowGridLines = true, + }; + for (int iRow = 0; iRow < GridRowsNumber; iRow++) + { + var row = grid.Rows[iRow]; + SetGridRowLength(row); + for (int iColumn = 0; iColumn < GridColumnsNumber; iColumn++) + { + var column = grid.Columns[iColumn]; + SetGridColumnLength(column); + grid.AddChild(new TextBlock + { + Text = string.Format("Row {0} and Column {1}", iRow, iColumn), + Margin = 5, + ForegroundColor = Color.Black, + FontWeight = FontWeight.ExtraBold + }, iRow, iColumn); + } + } + Chart.AddControl(grid); + } + private void SetGridRowLength(GridRow row) + { + switch (GridRowLengthUnitType) + { + case GridUnitType.Auto: + row.SetHeightToAuto(); + break; + case GridUnitType.Pixel: + row.SetHeightInPixels(GridRowLength); + break; + case GridUnitType.Star: + row.SetHeightInStars(GridRowLength); + break; + } + } + private void SetGridColumnLength(GridColumn column) + { + switch (GridColumnLengthUnitType) + { + case GridUnitType.Auto: + column.SetWidthToAuto(); + break; + case GridUnitType.Pixel: + column.SetWidthInPixels(GridColumnLength); + break; + case GridUnitType.Star: + column.SetWidthInStars(GridColumnLength); + break; + } + } + public override void Calculate(int index) + { + } + } +} diff --git a/Indicators/GridColumn Sample/GridColumn Sample/GridColumn Sample.cs b/Indicators/GridColumn Sample/GridColumn Sample/GridColumn Sample.cs index da77113..414db70 100644 --- a/Indicators/GridColumn Sample/GridColumn Sample/GridColumn Sample.cs +++ b/Indicators/GridColumn Sample/GridColumn Sample/GridColumn Sample.cs @@ -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. @@ -25,7 +25,7 @@ public class GridColumnSample : Indicator protected override void Initialize() { - var grid = new Grid(5, GridColumnsNumber) + var grid = new Grid(5, GridColumnsNumber) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -39,7 +39,7 @@ protected override void Initialize() { var column = grid.Columns[iColumn]; SetGridColumnLength(column); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = string.Format("Row {0} and Column {1}", iRow, iColumn), Margin = 5, diff --git a/Indicators/GridLength Sample/GridLength Sample/GridLength Sample.cs b/Indicators/GridLength Sample/GridLength Sample/GridLength Sample.cs index e992274..a5bee20 100644 --- a/Indicators/GridLength Sample/GridLength Sample/GridLength Sample.cs +++ b/Indicators/GridLength Sample/GridLength Sample/GridLength Sample.cs @@ -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. @@ -28,7 +28,7 @@ public class GridLengthSample : Indicator protected override void Initialize() { - var grid = new Grid(2, 2) + var grid = new Grid(2, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -44,7 +44,7 @@ protected override void Initialize() { var column = grid.Columns[iColumn]; SetGridColumnLength(column); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = string.Format("Row {0} and Column {1}", iRow, iColumn), Margin = 5, diff --git a/Indicators/GridRow Sample/GridRow Sample/GridRow Sample.cs b/Indicators/GridRow Sample/GridRow Sample/GridRow Sample.cs index 8255985..138d0f7 100644 --- a/Indicators/GridRow Sample/GridRow Sample/GridRow Sample.cs +++ b/Indicators/GridRow Sample/GridRow Sample/GridRow Sample.cs @@ -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. @@ -25,7 +25,7 @@ public class GridRowSample : Indicator protected override void Initialize() { - var grid = new Grid(GridRowsNumber, 2) + var grid = new Grid(GridRowsNumber, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -41,7 +41,7 @@ protected override void Initialize() for (int iColumn = 0; iColumn < 2; iColumn++) { - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = string.Format("Row {0} and Column {1}", iRow, iColumn), Margin = 5, diff --git a/Indicators/GridUnitType Sample/GridUnitType Sample/GridUnitType Sample.cs b/Indicators/GridUnitType Sample/GridUnitType Sample/GridUnitType Sample.cs index cd59a89..47ffb01 100644 --- a/Indicators/GridUnitType Sample/GridUnitType Sample/GridUnitType Sample.cs +++ b/Indicators/GridUnitType Sample/GridUnitType Sample/GridUnitType Sample.cs @@ -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. @@ -28,7 +28,7 @@ public class GridUnitTypeSample : Indicator protected override void Initialize() { - var grid = new Grid(2, 2) + var grid = new Grid(2, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -44,7 +44,7 @@ protected override void Initialize() { var column = grid.Columns[iColumn]; SetGridColumnLength(column); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = string.Format("Row {0} and Column {1}", iRow, iColumn), Margin = 5, diff --git a/Indicators/HistoricalTrade Sample/HistoricalTrade Sample/HistoricalTrade Sample.cs b/Indicators/HistoricalTrade Sample/HistoricalTrade Sample/HistoricalTrade Sample.cs index 6d9190f..0e6685e 100644 --- a/Indicators/HistoricalTrade Sample/HistoricalTrade Sample/HistoricalTrade Sample.cs +++ b/Indicators/HistoricalTrade Sample/HistoricalTrade Sample/HistoricalTrade Sample.cs @@ -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. @@ -21,7 +21,7 @@ public class HistorySample : Indicator protected override void Initialize() { - _stackPanel = new StackPanel + _stackPanel = new StackPanel { Orientation = Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, @@ -30,7 +30,7 @@ protected override void Initialize() }; _textBlocksStyle = new Style(); _textBlocksStyle.Set(ControlProperty.Margin, 5); - _stackPanel.AddChild(new TextBox + _stackPanel.AddChild(new TextBox { Text = "Your Last 10 Trades", FontWeight = FontWeight.ExtraBold, @@ -54,32 +54,32 @@ private void UpdateLastTradeTextBlock() if (_tradesGrid != null) _stackPanel.RemoveChild(_tradesGrid); _tradesGrid = new Grid(11, 6); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Symbol", Style = _textBlocksStyle }, 0, 0); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Direction", Style = _textBlocksStyle }, 0, 1); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Volume", Style = _textBlocksStyle }, 0, 2); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Open Time", Style = _textBlocksStyle }, 0, 3); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Close Time", Style = _textBlocksStyle }, 0, 4); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = "Net Profit", Style = _textBlocksStyle @@ -90,32 +90,32 @@ private void UpdateLastTradeTextBlock() for (int iRowIndex = 1; iRowIndex <= lastTenTrades.Length; iRowIndex++) { var trade = lastTenTrades[iRowIndex - 1]; - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.SymbolName, Style = _textBlocksStyle }, iRowIndex, 0); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.TradeType.ToString(), Style = _textBlocksStyle }, iRowIndex, 1); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.VolumeInUnits.ToString(), Style = _textBlocksStyle }, iRowIndex, 2); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.EntryTime.ToString("g"), Style = _textBlocksStyle }, iRowIndex, 3); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.ClosingTime.ToString("g"), Style = _textBlocksStyle }, iRowIndex, 4); - _tradesGrid.AddChild(new TextBlock + _tradesGrid.AddChild(new TextBlock { Text = trade.NetProfit.ToString(), Style = _textBlocksStyle diff --git a/Indicators/HorizontalAlignment Sample/HorizontalAlignment Sample/HorizontalAlignment Sample.cs b/Indicators/HorizontalAlignment Sample/HorizontalAlignment Sample/HorizontalAlignment Sample.cs index a2a4e76..d4d86c3 100644 --- a/Indicators/HorizontalAlignment Sample/HorizontalAlignment Sample/HorizontalAlignment Sample.cs +++ b/Indicators/HorizontalAlignment Sample/HorizontalAlignment Sample/HorizontalAlignment Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class HorizontalAlignmentSample : Indicator protected override void Initialize() { - var textBlock = new TextBlock + var textBlock = new TextBlock { Text = string.Format("Alignment: {0}", HorizontalAlignment), HorizontalAlignment = HorizontalAlignment, diff --git a/Indicators/HorizontalLine Sample/HorizontalLine Sample/HorizontalLine Sample.cs b/Indicators/HorizontalLine Sample/HorizontalLine Sample/HorizontalLine Sample.cs index 02cb847..85c19f0 100644 --- a/Indicators/HorizontalLine Sample/HorizontalLine Sample/HorizontalLine Sample.cs +++ b/Indicators/HorizontalLine Sample/HorizontalLine Sample/HorizontalLine Sample.cs @@ -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. diff --git a/Indicators/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample.cs b/Indicators/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample.cs index 4544a3a..6c160ef 100644 --- a/Indicators/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample.cs +++ b/Indicators/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample/IIndicatorsAccessor Sample.cs @@ -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. diff --git a/Indicators/Image Sample/Image Sample/Image Sample.cs b/Indicators/Image Sample/Image Sample/Image Sample.cs index b5a731a..e8d5e30 100644 --- a/Indicators/Image Sample/Image Sample/Image Sample.cs +++ b/Indicators/Image Sample/Image Sample/Image Sample.cs @@ -1,42 +1,42 @@ - // ------------------------------------------------------------------------------------------------- +// ------------------------------------------------------------------------------------------------- // -// 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. // // ------------------------------------------------------------------------------------------------- - - using cAlgo.API; - using System.IO; - namespace cAlgo - { - [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)] - public class ImageSample : Indicator - { - [Parameter("Image File Path")] - public string ImageFilePath { get; set; } - - protected override void Initialize() - { - if (!File.Exists(ImageFilePath)) - { - Print($"Image not found: {ImageFilePath}"); - return; - } - var imageBytes = File.ReadAllBytes(ImageFilePath); - var image = new Image - { - Source = imageBytes, - Width = 200, - Height = 200, - HorizontalAlignment = HorizontalAlignment.Center, - VerticalAlignment = VerticalAlignment.Center - }; - Chart.AddControl(image); - } - public override void Calculate(int index) - { - } - } - } + +using cAlgo.API; +using System.IO; +namespace cAlgo +{ + [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)] + public class ImageSample : Indicator + { + [Parameter("Image File Path")] + public string ImageFilePath { get; set; } + + protected override void Initialize() + { + if (!File.Exists(ImageFilePath)) + { + Print($"Image not found: {ImageFilePath}"); + return; + } + var imageBytes = File.ReadAllBytes(ImageFilePath); + var image = new Image + { + Source = imageBytes, + Width = 200, + Height = 200, + HorizontalAlignment = HorizontalAlignment.Center, + VerticalAlignment = VerticalAlignment.Center + }; + Chart.AddControl(image); + } + public override void Calculate(int index) + { + } + } +} diff --git a/Indicators/Indicator Area Sample/Indicator Area Sample/Indicator Area Sample.cs b/Indicators/Indicator Area Sample/Indicator Area Sample/Indicator Area Sample.cs index 0251ec8..eca2035 100644 --- a/Indicators/Indicator Area Sample/Indicator Area Sample/Indicator Area Sample.cs +++ b/Indicators/Indicator Area Sample/Indicator Area Sample/Indicator Area Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class IndicatorAreaSample : Indicator protected override void Initialize() { - var grid = new Grid(1, 2) + var grid = new Grid(1, 2) { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -27,7 +27,7 @@ protected override void Initialize() Width = 200 }; - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Indicator Area #", Margin = 5, @@ -35,7 +35,7 @@ protected override void Initialize() ForegroundColor = Color.Black }, 0, 0); - _indicatorAreaNumberTextBlock = new TextBlock + _indicatorAreaNumberTextBlock = new TextBlock { Margin = 5, Text = Chart.IndicatorAreas.Count.ToString(), diff --git a/Indicators/Indicator Data Series Sample/Indicator Data Series Sample/Indicator Data Series Sample.cs b/Indicators/Indicator Data Series Sample/Indicator Data Series Sample/Indicator Data Series Sample.cs index 57fd27f..d905623 100644 --- a/Indicators/Indicator Data Series Sample/Indicator Data Series Sample/Indicator Data Series Sample.cs +++ b/Indicators/Indicator Data Series Sample/Indicator Data Series Sample/Indicator Data Series Sample.cs @@ -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. diff --git a/Indicators/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample.cs b/Indicators/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample.cs index f5d09c5..f2a4786 100644 --- a/Indicators/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample.cs +++ b/Indicators/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample/IndicatorAreaAddedEventArgs Sample.cs @@ -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. diff --git a/Indicators/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample.cs b/Indicators/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample.cs index f156f71..6e8e8c1 100644 --- a/Indicators/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample.cs +++ b/Indicators/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample/IndicatorAreaEventArgs Sample.cs @@ -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. diff --git a/Indicators/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample.cs b/Indicators/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample.cs index edafc5a..de0efdc 100644 --- a/Indicators/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample.cs +++ b/Indicators/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample/IndicatorAreaRemovedEventArgs Sample.cs @@ -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. diff --git a/Indicators/Key Sample/Key Sample/Key Sample.cs b/Indicators/Key Sample/Key Sample/Key Sample.cs index 40b05b2..1a05b5b 100644 --- a/Indicators/Key Sample/Key Sample/Key Sample.cs +++ b/Indicators/Key Sample/Key Sample/Key Sample.cs @@ -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. diff --git a/Indicators/Levels Sample/Levels Sample/Levels Sample.cs b/Indicators/Levels Sample/Levels Sample/Levels Sample.cs index 71f0040..ae6a151 100644 --- a/Indicators/Levels Sample/Levels Sample/Levels Sample.cs +++ b/Indicators/Levels Sample/Levels Sample/Levels Sample.cs @@ -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. diff --git a/Indicators/Line Shape Sample/Line Shape Sample/Line Shape Sample.cs b/Indicators/Line Shape Sample/Line Shape Sample/Line Shape Sample.cs index c2aff4e..f1df7fe 100644 --- a/Indicators/Line Shape Sample/Line Shape Sample/Line Shape Sample.cs +++ b/Indicators/Line Shape Sample/Line Shape Sample/Line Shape Sample.cs @@ -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. @@ -19,7 +19,7 @@ protected override void Initialize() var xCenter = Chart.Width / 2; var yCenter = Chart.Height / 2; - var line = new Line + var line = new Line { X1 = xCenter, X2 = xCenter + 100, diff --git a/Indicators/Line Stacking Strategy Sample/Line Stacking Strategy Sample/Line Stacking Strategy Sample.cs b/Indicators/Line Stacking Strategy Sample/Line Stacking Strategy Sample/Line Stacking Strategy Sample.cs index c680a1b..ac45acf 100644 --- a/Indicators/Line Stacking Strategy Sample/Line Stacking Strategy Sample/Line Stacking Strategy Sample.cs +++ b/Indicators/Line Stacking Strategy Sample/Line Stacking Strategy Sample/Line Stacking Strategy Sample.cs @@ -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. @@ -17,7 +17,7 @@ public class LineStackingStrategySample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { Orientation = Orientation.Vertical, BackgroundColor = Color.Gold, @@ -34,7 +34,7 @@ protected override void Initialize() stringBuilder.AppendLine("Fourth line of text"); stringBuilder.AppendLine("Fifth line of text"); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Margin = 5, Text = "LineStackingStrategy = BlockLineHeight:\n" + stringBuilder.ToString(), @@ -43,7 +43,7 @@ protected override void Initialize() ForegroundColor = Color.Black }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Margin = 5, Text = "LineStackingStrategy = MaxHeight:\n" + stringBuilder.ToString(), diff --git a/Indicators/Line Style Sample/Line Style Sample/Line Style Sample.cs b/Indicators/Line Style Sample/Line Style Sample/Line Style Sample.cs index 1fc5a67..f3390ef 100644 --- a/Indicators/Line Style Sample/Line Style Sample/Line Style Sample.cs +++ b/Indicators/Line Style Sample/Line Style Sample/Line Style Sample.cs @@ -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. diff --git a/Indicators/Market Data Sample/Market Data Sample/Market Data Sample.cs b/Indicators/Market Data Sample/Market Data Sample/Market Data Sample.cs index edecf3d..e08c5a3 100644 --- a/Indicators/Market Data Sample/Market Data Sample/Market Data Sample.cs +++ b/Indicators/Market Data Sample/Market Data Sample/Market Data Sample.cs @@ -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. @@ -44,7 +44,7 @@ protected override void Initialize() _ticks = MarketData.GetTicks(symbol.Name); _marketDepth = MarketData.GetMarketDepth(symbol.Name); - + } public override void Calculate(int index) diff --git a/Indicators/Market Depth Ladder/Market Depth Ladder/Market Depth Ladder.cs b/Indicators/Market Depth Ladder/Market Depth Ladder/Market Depth Ladder.cs index 2958884..44da001 100644 --- a/Indicators/Market Depth Ladder/Market Depth Ladder/Market Depth Ladder.cs +++ b/Indicators/Market Depth Ladder/Market Depth Ladder/Market Depth Ladder.cs @@ -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. diff --git a/Indicators/Market Depth Sample/Market Depth Sample/Market Depth Sample.cs b/Indicators/Market Depth Sample/Market Depth Sample/Market Depth Sample.cs index 4e776a2..068802d 100644 --- a/Indicators/Market Depth Sample/Market Depth Sample/Market Depth Sample.cs +++ b/Indicators/Market Depth Sample/Market Depth Sample/Market Depth Sample.cs @@ -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. diff --git a/Indicators/Market Snapshot Sample/Market Snapshot Sample/Market Snapshot Sample.cs b/Indicators/Market Snapshot Sample/Market Snapshot Sample/Market Snapshot Sample.cs index 65fcd5f..9089c37 100644 --- a/Indicators/Market Snapshot Sample/Market Snapshot Sample/Market Snapshot Sample.cs +++ b/Indicators/Market Snapshot Sample/Market Snapshot Sample/Market Snapshot Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class MarketSnapshotSample : Indicator protected override void Initialize() { - _marketSnapshotControl = new MarketSnapshotControl + _marketSnapshotControl = new MarketSnapshotControl { BackgroundColor = Color.Gold, BorderColor = Color.Gray, @@ -87,7 +87,7 @@ public class MarketSnapshotControl : CustomControl public MarketSnapshotControl() { - _border = new Border + _border = new Border { BackgroundColor = "#3F3F3F", BorderColor = "#969696", @@ -103,62 +103,62 @@ public MarketSnapshotControl() style.Set(ControlProperty.HorizontalContentAlignment, HorizontalAlignment.Left); style.Set(ControlProperty.VerticalContentAlignment, VerticalAlignment.Center); - _openTextBlock = new TextBlock + _openTextBlock = new TextBlock { Style = style }; - _highTextBlock = new TextBlock + _highTextBlock = new TextBlock { Style = style }; - _lowTextBlock = new TextBlock + _lowTextBlock = new TextBlock { Style = style }; - _closeTextBlock = new TextBlock + _closeTextBlock = new TextBlock { Style = style }; - _volumeTextBlock = new TextBlock + _volumeTextBlock = new TextBlock { Style = style }; - _timeTextBlock = new TextBlock + _timeTextBlock = new TextBlock { Style = style }; - var grid = new Grid(6, 2) + var grid = new Grid(6, 2) { ShowGridLines = true }; - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Open", Style = style }, 0, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "High", Style = style }, 1, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Low", Style = style }, 2, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Close", Style = style }, 3, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume", Style = style }, 4, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time", Style = style diff --git a/Indicators/MarketHours Sample/MarketHours Sample/MarketHours Sample.cs b/Indicators/MarketHours Sample/MarketHours Sample/MarketHours Sample.cs index 3a0fb75..2bc5562 100644 --- a/Indicators/MarketHours Sample/MarketHours Sample/MarketHours Sample.cs +++ b/Indicators/MarketHours Sample/MarketHours Sample/MarketHours Sample.cs @@ -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. @@ -32,7 +32,7 @@ public class MarketHoursSample : Indicator protected override void Initialize() { - var grid = new Grid(6, 2) + var grid = new Grid(6, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -49,20 +49,20 @@ protected override void Initialize() _symbol = UseCurrentSymbol ? Symbol : Symbols.GetSymbol(OtherSymbolName); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Symbol Info", Style = style, HorizontalAlignment = HorizontalAlignment.Center }, 0, 0, 1, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Open", Style = style }, 1, 0); - _timeTillOpenTextBlock = new TextBlock + _timeTillOpenTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillOpen().ToString(), Style = style @@ -70,13 +70,13 @@ protected override void Initialize() grid.AddChild(_timeTillOpenTextBlock, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Close", Style = style }, 2, 0); - _timeTillCloseTextBlock = new TextBlock + _timeTillCloseTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillClose().ToString(), Style = style @@ -84,13 +84,13 @@ protected override void Initialize() grid.AddChild(_timeTillCloseTextBlock, 2, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Is Opened", Style = style }, 3, 0); - _isOpenedTextBlock = new TextBlock + _isOpenedTextBlock = new TextBlock { Text = _symbol.MarketHours.IsOpened().ToString(), Style = style @@ -98,19 +98,19 @@ protected override void Initialize() grid.AddChild(_isOpenedTextBlock, 3, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Sessions #", Style = style }, 4, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.MarketHours.Sessions.Count.ToString(), Style = style }, 4, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Session Week Days", Style = style @@ -124,7 +124,7 @@ protected override void Initialize() weekDays = iSession == 0 ? currentSessionWeekDays : string.Format("{0}, {1}", weekDays, currentSessionWeekDays); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = weekDays, Style = style diff --git a/Indicators/ModifierKeys Sample/ModifierKeys Sample/ModifierKeys Sample.cs b/Indicators/ModifierKeys Sample/ModifierKeys Sample/ModifierKeys Sample.cs index 817fde9..7f600b5 100644 --- a/Indicators/ModifierKeys Sample/ModifierKeys Sample/ModifierKeys Sample.cs +++ b/Indicators/ModifierKeys Sample/ModifierKeys Sample/ModifierKeys Sample.cs @@ -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. diff --git a/Indicators/Normalizing Volume Sample/Normalizing Volume Sample/Normalizing Volume Sample.cs b/Indicators/Normalizing Volume Sample/Normalizing Volume Sample/Normalizing Volume Sample.cs index 901e151..833b3b9 100644 --- a/Indicators/Normalizing Volume Sample/Normalizing Volume Sample/Normalizing Volume Sample.cs +++ b/Indicators/Normalizing Volume Sample/Normalizing Volume Sample/Normalizing Volume Sample.cs @@ -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. diff --git a/Indicators/Notifications Sample/Notifications Sample/Notifications Sample.cs b/Indicators/Notifications Sample/Notifications Sample/Notifications Sample.cs index 89ffe89..2895dd6 100644 --- a/Indicators/Notifications Sample/Notifications Sample/Notifications Sample.cs +++ b/Indicators/Notifications Sample/Notifications Sample/Notifications Sample.cs @@ -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. diff --git a/Indicators/Orientation Sample/Orientation Sample/Orientation Sample.cs b/Indicators/Orientation Sample/Orientation Sample/Orientation Sample.cs index 73764ce..74d5d7a 100644 --- a/Indicators/Orientation Sample/Orientation Sample/Orientation Sample.cs +++ b/Indicators/Orientation Sample/Orientation Sample/Orientation Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class OrientationSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { Orientation = Orientation, HorizontalAlignment = HorizontalAlignment.Center, @@ -28,28 +28,28 @@ protected override void Initialize() Opacity = 0.7 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "First TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Second TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Third TextBlock", FontWeight = FontWeight.ExtraBold, Margin = 5, ForegroundColor = Color.Black }); - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Fourth TextBlock", FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/Output Attribute Sample/Output Attribute Sample/Output Attribute Sample.cs b/Indicators/Output Attribute Sample/Output Attribute Sample/Output Attribute Sample.cs index a274daa..ae40678 100644 --- a/Indicators/Output Attribute Sample/Output Attribute Sample/Output Attribute Sample.cs +++ b/Indicators/Output Attribute Sample/Output Attribute Sample/Output Attribute Sample.cs @@ -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. diff --git a/Indicators/Output Snapshot Sample/Output Snapshot Sample/Output Snapshot Sample.cs b/Indicators/Output Snapshot Sample/Output Snapshot Sample/Output Snapshot Sample.cs index 9a24b6c..6795c5d 100644 --- a/Indicators/Output Snapshot Sample/Output Snapshot Sample/Output Snapshot Sample.cs +++ b/Indicators/Output Snapshot Sample/Output Snapshot Sample/Output Snapshot Sample.cs @@ -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. @@ -32,7 +32,7 @@ protected override void Initialize() _ma = Indicators.MovingAverage(Bars.ClosePrices, 9, MovingAverageType.Exponential); - _marketSnapshotControl = new MarketSnapshotControl + _marketSnapshotControl = new MarketSnapshotControl { BackgroundColor = Color.Gold, BorderColor = Color.Gray, @@ -99,7 +99,7 @@ public class MarketSnapshotControl : CustomControl public MarketSnapshotControl() { - _border = new Border + _border = new Border { BackgroundColor = "#3F3F3F", BorderColor = "#969696", @@ -115,26 +115,26 @@ public MarketSnapshotControl() style.Set(ControlProperty.HorizontalContentAlignment, HorizontalAlignment.Left); style.Set(ControlProperty.VerticalContentAlignment, VerticalAlignment.Center); - _valueTextBlock = new TextBlock + _valueTextBlock = new TextBlock { Style = style }; - _timeTextBlock = new TextBlock + _timeTextBlock = new TextBlock { Style = style }; - var grid = new Grid(2, 2) + var grid = new Grid(2, 2) { ShowGridLines = true }; - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Value", Style = style }, 0, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time", Style = style diff --git a/Indicators/Parameter Attribute Sample/Parameter Attribute Sample/Parameter Attribute Sample.cs b/Indicators/Parameter Attribute Sample/Parameter Attribute Sample/Parameter Attribute Sample.cs index c906749..a478905 100644 --- a/Indicators/Parameter Attribute Sample/Parameter Attribute Sample/Parameter Attribute Sample.cs +++ b/Indicators/Parameter Attribute Sample/Parameter Attribute Sample/Parameter Attribute Sample.cs @@ -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. diff --git a/Indicators/PenLineCap Sample/PenLineCap Sample/PenLineCap Sample.cs b/Indicators/PenLineCap Sample/PenLineCap Sample/PenLineCap Sample.cs index 7eb6805..77909a6 100644 --- a/Indicators/PenLineCap Sample/PenLineCap Sample/PenLineCap Sample.cs +++ b/Indicators/PenLineCap Sample/PenLineCap Sample/PenLineCap Sample.cs @@ -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. @@ -25,7 +25,7 @@ public class PenLineCapSample : Indicator protected override void Initialize() { - var rectangle = new Rectangle + var rectangle = new Rectangle { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, diff --git a/Indicators/PenLineJoin Sample/PenLineJoin Sample/PenLineJoin Sample.cs b/Indicators/PenLineJoin Sample/PenLineJoin Sample/PenLineJoin Sample.cs index 44a4db6..90ac580 100644 --- a/Indicators/PenLineJoin Sample/PenLineJoin Sample/PenLineJoin Sample.cs +++ b/Indicators/PenLineJoin Sample/PenLineJoin Sample/PenLineJoin Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class PenLineJoinSample : Indicator protected override void Initialize() { - var rectangle = new Rectangle + var rectangle = new Rectangle { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, diff --git a/Indicators/PlotType Sample/PlotType Sample/PlotType Sample.cs b/Indicators/PlotType Sample/PlotType Sample/PlotType Sample.cs index 66c4d48..0c8a72d 100644 --- a/Indicators/PlotType Sample/PlotType Sample/PlotType Sample.cs +++ b/Indicators/PlotType Sample/PlotType Sample/PlotType Sample.cs @@ -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. diff --git a/Indicators/Polygon Sample/Polygon Sample/Polygon Sample.cs b/Indicators/Polygon Sample/Polygon Sample/Polygon Sample.cs index a9fbde2..84b933c 100644 --- a/Indicators/Polygon Sample/Polygon Sample/Polygon Sample.cs +++ b/Indicators/Polygon Sample/Polygon Sample/Polygon Sample.cs @@ -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. @@ -16,13 +16,13 @@ public class PolygonSample : Indicator { protected override void Initialize() { - Chart.AddControl(new Polygon + Chart.AddControl(new Polygon { FillColor = Color.Red, Width = 200, Height = 100, Margin = 10, - Points = new Point[] + Points = new Point[] { new Point(100, 100), new Point(200, 50), diff --git a/Indicators/Polyline Sample/Polyline Sample/Polyline Sample.cs b/Indicators/Polyline Sample/Polyline Sample/Polyline Sample.cs index 988f4f7..f4abb2f 100644 --- a/Indicators/Polyline Sample/Polyline Sample/Polyline Sample.cs +++ b/Indicators/Polyline Sample/Polyline Sample/Polyline Sample.cs @@ -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. @@ -16,13 +16,13 @@ public class PolylineSample : Indicator { protected override void Initialize() { - Chart.AddControl(new Polyline + Chart.AddControl(new Polyline { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, StrokeColor = Color.Red, StrokeThickness = 1, - Points = new[] + Points = new[] { new Point(10, 10), new Point(100, 200), diff --git a/Indicators/Radio Button Sample/Radio Button Sample/Radio Button Sample.cs b/Indicators/Radio Button Sample/Radio Button Sample/Radio Button Sample.cs index adae188..3d319d7 100644 --- a/Indicators/Radio Button Sample/Radio Button Sample/Radio Button Sample.cs +++ b/Indicators/Radio Button Sample/Radio Button Sample/Radio Button Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class RadioButtonSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.7 }; - var firstRadioButton = new RadioButton + var firstRadioButton = new RadioButton { Text = "Unchecked" }; @@ -34,7 +34,7 @@ protected override void Initialize() stackPanel.AddChild(firstRadioButton); - var secondRadioButton = new RadioButton + var secondRadioButton = new RadioButton { Text = "Unchecked" }; diff --git a/Indicators/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample.cs b/Indicators/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample.cs index 8d4f248..5ceeccf 100644 --- a/Indicators/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample.cs +++ b/Indicators/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample/RadioButtonEventArgs Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class RadioButtonEventArgsSample : Indicator { protected override void Initialize() { - var firstRadioButton = new RadioButton + var firstRadioButton = new RadioButton { Text = "First Radio Button" }; @@ -24,7 +24,7 @@ protected override void Initialize() firstRadioButton.Checked += RadioButton_Changed; firstRadioButton.Unchecked += RadioButton_Changed; - var secondRadioButton = new RadioButton + var secondRadioButton = new RadioButton { Text = "Second Radio Button" }; @@ -32,7 +32,7 @@ protected override void Initialize() secondRadioButton.Checked += RadioButton_Changed; secondRadioButton.Unchecked += RadioButton_Changed; - var panel = new StackPanel + var panel = new StackPanel { Orientation = Orientation.Vertical, HorizontalAlignment = HorizontalAlignment.Center, diff --git a/Indicators/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample.cs b/Indicators/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample.cs index a431af9..40041ed 100644 --- a/Indicators/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample.cs +++ b/Indicators/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample/Rectangle Corner Radius Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class RectangleCornerRadiusSample : Indicator { protected override void Initialize() { - var rectangle = new Rectangle + var rectangle = new Rectangle { RadiusX = 20, RadiusY = 20, diff --git a/Indicators/Rectangle Shape Sample/Rectangle Shape Sample/Rectangle Shape Sample.cs b/Indicators/Rectangle Shape Sample/Rectangle Shape Sample/Rectangle Shape Sample.cs index 81f8906..25e9359 100644 --- a/Indicators/Rectangle Shape Sample/Rectangle Shape Sample/Rectangle Shape Sample.cs +++ b/Indicators/Rectangle Shape Sample/Rectangle Shape Sample/Rectangle Shape Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class RectangleShapeSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - var rectangle = new Rectangle + var rectangle = new Rectangle { StrokeColor = Color.Blue, FillColor = Color.Red, diff --git a/Indicators/ScrollBarVisibility Sample/ScrollBarVisibility Sample/ScrollBarVisibility Sample.cs b/Indicators/ScrollBarVisibility Sample/ScrollBarVisibility Sample/ScrollBarVisibility Sample.cs index b0e187a..7f58efc 100644 --- a/Indicators/ScrollBarVisibility Sample/ScrollBarVisibility Sample/ScrollBarVisibility Sample.cs +++ b/Indicators/ScrollBarVisibility Sample/ScrollBarVisibility Sample/ScrollBarVisibility Sample.cs @@ -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. @@ -22,7 +22,7 @@ public class ScrollBarVisibilitySample : Indicator protected override void Initialize() { - var scrollViewer = new ScrollViewer + var scrollViewer = new ScrollViewer { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -33,7 +33,7 @@ protected override void Initialize() Height = 100 }; - var grid = new Grid(10, 2) + var grid = new Grid(10, 2) { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -44,7 +44,7 @@ protected override void Initialize() for (int iRow = 0; iRow < 10; iRow++) { - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Text", Margin = 5, @@ -52,7 +52,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }, iRow, 0); - grid.AddChild(new Button + grid.AddChild(new Button { Text = "Button", Margin = 5, diff --git a/Indicators/ScrollViewer Sample/ScrollViewer Sample/ScrollViewer Sample.cs b/Indicators/ScrollViewer Sample/ScrollViewer Sample/ScrollViewer Sample.cs index 251a1fe..ff80446 100644 --- a/Indicators/ScrollViewer Sample/ScrollViewer Sample/ScrollViewer Sample.cs +++ b/Indicators/ScrollViewer Sample/ScrollViewer Sample/ScrollViewer Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class ScrollViewerSample : Indicator { protected override void Initialize() { - var scrollViewer = new ScrollViewer + var scrollViewer = new ScrollViewer { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -27,7 +27,7 @@ protected override void Initialize() Height = 100 }; - var grid = new Grid(10, 2) + var grid = new Grid(10, 2) { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -38,7 +38,7 @@ protected override void Initialize() for (int iRow = 0; iRow < 10; iRow++) { - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Text", Margin = 5, @@ -46,7 +46,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }, iRow, 0); - grid.AddChild(new Button + grid.AddChild(new Button { Text = "Button", Margin = 5, diff --git a/Indicators/Server Sample/Server Sample/Server Sample.cs b/Indicators/Server Sample/Server Sample/Server Sample.cs index ce77f08..2c33a0f 100644 --- a/Indicators/Server Sample/Server Sample/Server Sample.cs +++ b/Indicators/Server Sample/Server Sample/Server Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class ServerSample : Indicator protected override void Initialize() { - var grid = new Grid(4, 2) + var grid = new Grid(4, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -33,42 +33,42 @@ 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 = "Server Info", Style = style, HorizontalAlignment = HorizontalAlignment.Center }, 0, 0, 1, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time", Style = style }, 1, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = Server.Time.ToString("o"), Style = style }, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time (UTC)", Style = style }, 2, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = Server.TimeInUtc.ToString("o"), Style = style }, 2, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Is Connected", Style = style }, 3, 0); - _isConnectedTextBlock = new TextBlock + _isConnectedTextBlock = new TextBlock { Text = Server.IsConnected ? "Yes" : "No", Style = style diff --git a/Indicators/StackPanel Sample/StackPanel Sample/StackPanel Sample.cs b/Indicators/StackPanel Sample/StackPanel Sample/StackPanel Sample.cs index a0767bf..53d55b6 100644 --- a/Indicators/StackPanel Sample/StackPanel Sample/StackPanel Sample.cs +++ b/Indicators/StackPanel Sample/StackPanel Sample/StackPanel Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class StackPanelSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -29,7 +29,7 @@ protected override void Initialize() for (int i = 0; i < 10; i++) { - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Text", Margin = 5, diff --git a/Indicators/Stretch Sample/Stretch Sample/Stretch Sample.cs b/Indicators/Stretch Sample/Stretch Sample/Stretch Sample.cs index eae937e..df50cb1 100644 --- a/Indicators/Stretch Sample/Stretch Sample/Stretch Sample.cs +++ b/Indicators/Stretch Sample/Stretch Sample/Stretch Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class StretchSample : Indicator protected override void Initialize() { - var rectangle = new Rectangle + var rectangle = new Rectangle { Stretch = Stretch, HorizontalAlignment = HorizontalAlignment.Center, diff --git a/Indicators/StretchDirection Sample/StretchDirection Sample/StretchDirection Sample.cs b/Indicators/StretchDirection Sample/StretchDirection Sample/StretchDirection Sample.cs index 9acf0f9..b87341c 100644 --- a/Indicators/StretchDirection Sample/StretchDirection Sample/StretchDirection Sample.cs +++ b/Indicators/StretchDirection Sample/StretchDirection Sample/StretchDirection Sample.cs @@ -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. @@ -38,7 +38,7 @@ protected override void Initialize() return; } var imageBytes = File.ReadAllBytes(ImageFilePath); - + var image = new Image { Source = imageBytes, diff --git a/Indicators/Style Sample/Style Sample/Style Sample.cs b/Indicators/Style Sample/Style Sample/Style Sample.cs index 60f1e51..5392d26 100644 --- a/Indicators/Style Sample/Style Sample/Style Sample.cs +++ b/Indicators/Style Sample/Style Sample/Style Sample.cs @@ -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. @@ -23,7 +23,7 @@ protected override void Initialize() style.Set(ControlProperty.FontSize, 14); style.Set(ControlProperty.Width, 100); - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -33,7 +33,7 @@ protected override void Initialize() for (var i = 0; i < 10; i++) { - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Text Block #" + i, Style = style diff --git a/Indicators/Symbol Sample/Symbol Sample/Symbol Sample.cs b/Indicators/Symbol Sample/Symbol Sample/Symbol Sample.cs index 332955c..dc1429d 100644 --- a/Indicators/Symbol Sample/Symbol Sample/Symbol Sample.cs +++ b/Indicators/Symbol Sample/Symbol Sample/Symbol Sample.cs @@ -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. @@ -34,7 +34,7 @@ public class SymbolSample : Indicator protected override void Initialize() { - var grid = new Grid(24, 2) + var grid = new Grid(24, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -51,152 +51,152 @@ protected override void Initialize() _symbol = UseCurrentSymbol ? Symbol : Symbols.GetSymbol(OtherSymbolName); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Symbol Info", Style = style, HorizontalAlignment = HorizontalAlignment.Center }, 0, 0, 1, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Name", Style = style }, 1, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Name, Style = style }, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "ID", Style = style }, 2, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Id.ToString(), Style = style }, 2, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Digits", Style = style }, 3, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Digits.ToString(), Style = style }, 3, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Description", Style = style }, 4, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Description, Style = style }, 4, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Lot Size", Style = style }, 5, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.LotSize.ToString(), Style = style }, 5, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Pip Size", Style = style }, 6, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.PipSize.ToString(), Style = style }, 6, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Pip Value", Style = style }, 7, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.PipValue.ToString(), Style = style }, 7, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Tick Size", Style = style }, 8, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.TickSize.ToString(), Style = style }, 8, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Tick Value", Style = style }, 9, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.TickValue.ToString(), Style = style }, 9, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Max", Style = style }, 10, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsMax.ToString(), Style = style }, 10, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Min", Style = style }, 11, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsMin.ToString(), Style = style }, 11, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Step", Style = style }, 12, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsStep.ToString(), Style = style }, 12, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Ask", Style = style }, 13, 0); - _askTextBlock = new TextBlock + _askTextBlock = new TextBlock { Text = _symbol.Ask.ToString(), Style = style @@ -204,13 +204,13 @@ protected override void Initialize() grid.AddChild(_askTextBlock, 13, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Bid", Style = style }, 14, 0); - _bidTextBlock = new TextBlock + _bidTextBlock = new TextBlock { Text = _symbol.Bid.ToString(), Style = style @@ -218,13 +218,13 @@ protected override void Initialize() grid.AddChild(_bidTextBlock, 14, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Spread", Style = style }, 15, 0); - _spreadTextBlock = new TextBlock + _spreadTextBlock = new TextBlock { Text = _symbol.Spread.ToString(), Style = style @@ -232,13 +232,13 @@ protected override void Initialize() grid.AddChild(_spreadTextBlock, 15, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Unrealized Gross Profit", Style = style }, 16, 0); - _unrealizedGrossProfitTextBlock = new TextBlock + _unrealizedGrossProfitTextBlock = new TextBlock { Text = _symbol.UnrealizedGrossProfit.ToString(), Style = style @@ -246,13 +246,13 @@ protected override void Initialize() grid.AddChild(_unrealizedGrossProfitTextBlock, 16, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Unrealized Net Profit", Style = style }, 17, 0); - _unrealizedNetProfitTextBlock = new TextBlock + _unrealizedNetProfitTextBlock = new TextBlock { Text = _symbol.UnrealizedNetProfit.ToString(), Style = style @@ -260,13 +260,13 @@ protected override void Initialize() grid.AddChild(_unrealizedNetProfitTextBlock, 17, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Open", Style = style }, 18, 0); - _timeTillOpenTextBlock = new TextBlock + _timeTillOpenTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillOpen().ToString(), Style = style @@ -274,13 +274,13 @@ protected override void Initialize() grid.AddChild(_timeTillOpenTextBlock, 18, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Close", Style = style }, 19, 0); - _timeTillCloseTextBlock = new TextBlock + _timeTillCloseTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillClose().ToString(), Style = style @@ -288,13 +288,13 @@ protected override void Initialize() grid.AddChild(_timeTillCloseTextBlock, 19, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Is Opened", Style = style }, 20, 0); - _isOpenedTextBlock = new TextBlock + _isOpenedTextBlock = new TextBlock { Text = _symbol.MarketHours.IsOpened().ToString(), Style = style @@ -302,19 +302,19 @@ protected override void Initialize() grid.AddChild(_isOpenedTextBlock, 20, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Sessions #", Style = style }, 21, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.MarketHours.Sessions.Count.ToString(), Style = style }, 21, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Session Week Days", Style = style @@ -329,13 +329,13 @@ protected override void Initialize() weekDays = iSession == 0 ? currentSessionWeekDays : string.Format("{0}, {1}", weekDays, currentSessionWeekDays); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = weekDays, Style = style }, 22, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Leverage Tier", Style = style @@ -350,7 +350,7 @@ protected override void Initialize() leverageTiers = iLeveragTier == 0 ? currentLeverageTiers : string.Format("{0}, {1}", leverageTiers, currentLeverageTiers); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = leverageTiers, Style = style diff --git a/Indicators/SymbolInfo Sample/SymbolInfo Sample/SymbolInfo Sample.cs b/Indicators/SymbolInfo Sample/SymbolInfo Sample/SymbolInfo Sample.cs index 15d2b95..d958992 100644 --- a/Indicators/SymbolInfo Sample/SymbolInfo Sample/SymbolInfo Sample.cs +++ b/Indicators/SymbolInfo Sample/SymbolInfo Sample/SymbolInfo Sample.cs @@ -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. @@ -29,7 +29,7 @@ public class SymbolInfoSample : Indicator protected override void Initialize() { - var grid = new Grid(19, 2) + var grid = new Grid(19, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -46,152 +46,152 @@ protected override void Initialize() _symbol = UseCurrentSymbol ? Symbols.GetSymbol(SymbolName) : Symbols.GetSymbol(OtherSymbolName); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Symbol Info", Style = style, HorizontalAlignment = HorizontalAlignment.Center }, 0, 0, 1, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Name", Style = style }, 1, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Name, Style = style }, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "ID", Style = style }, 2, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Id.ToString(), Style = style }, 2, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Digits", Style = style }, 3, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Digits.ToString(), Style = style }, 3, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Description", Style = style }, 4, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.Description, Style = style }, 4, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Lot Size", Style = style }, 5, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.LotSize.ToString(), Style = style }, 5, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Pip Size", Style = style }, 6, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.PipSize.ToString(), Style = style }, 6, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Pip Value", Style = style }, 7, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.PipValue.ToString(), Style = style }, 7, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Tick Size", Style = style }, 8, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.TickSize.ToString(), Style = style }, 8, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Tick Value", Style = style }, 9, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.TickValue.ToString(), Style = style }, 9, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Max", Style = style }, 10, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsMax.ToString(), Style = style }, 10, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Min", Style = style }, 11, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsMin.ToString(), Style = style }, 11, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Volume In Units Step", Style = style }, 12, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.VolumeInUnitsStep.ToString(), Style = style }, 12, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Open", Style = style }, 13, 0); - _timeTillOpenTextBlock = new TextBlock + _timeTillOpenTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillOpen().ToString(), Style = style @@ -199,13 +199,13 @@ protected override void Initialize() grid.AddChild(_timeTillOpenTextBlock, 13, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Close", Style = style }, 14, 0); - _timeTillCloseTextBlock = new TextBlock + _timeTillCloseTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillClose().ToString(), Style = style @@ -213,13 +213,13 @@ protected override void Initialize() grid.AddChild(_timeTillCloseTextBlock, 14, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Is Opened", Style = style }, 15, 0); - _isOpenedTextBlock = new TextBlock + _isOpenedTextBlock = new TextBlock { Text = _symbol.MarketHours.IsOpened().ToString(), Style = style @@ -227,19 +227,19 @@ protected override void Initialize() grid.AddChild(_isOpenedTextBlock, 15, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Sessions #", Style = style }, 16, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.MarketHours.Sessions.Count.ToString(), Style = style }, 16, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Session Week Days", Style = style @@ -254,13 +254,13 @@ protected override void Initialize() weekDays = iSession == 0 ? currentSessionWeekDays : string.Format("{0}, {1}", weekDays, currentSessionWeekDays); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = weekDays, Style = style }, 17, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Leverage Tier", Style = style @@ -275,7 +275,7 @@ protected override void Initialize() leverageTiers = iLeveragTier == 0 ? currentLeverageTiers : string.Format("{0}, {1}", leverageTiers, currentLeverageTiers); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = leverageTiers, Style = style diff --git a/Indicators/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample.cs b/Indicators/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample.cs index ea54e26..3bbbb1d 100644 --- a/Indicators/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample.cs +++ b/Indicators/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample/SymbolTickEventArgs Sample.cs @@ -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. diff --git a/Indicators/Symbols Sample/Symbols Sample/Symbols Sample.cs b/Indicators/Symbols Sample/Symbols Sample/Symbols Sample.cs index 402ec3d..3c04b57 100644 --- a/Indicators/Symbols Sample/Symbols Sample/Symbols Sample.cs +++ b/Indicators/Symbols Sample/Symbols Sample/Symbols Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class SymbolsSample : Indicator { protected override void Initialize() { - var scrollViewer = new ScrollViewer + var scrollViewer = new ScrollViewer { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -27,7 +27,7 @@ protected override void Initialize() Height = 300 }; - var grid = new Grid(Symbols.Count, 2) + var grid = new Grid(Symbols.Count, 2) { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -44,7 +44,7 @@ protected override void Initialize() if (!symbol.MarketHours.IsOpened()) continue; - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = symbolName, Margin = 5, @@ -52,7 +52,7 @@ protected override void Initialize() FontWeight = FontWeight.ExtraBold }, iSymbol, 0); - grid.AddChild(new Button + grid.AddChild(new Button { Text = symbol.Description, Margin = 5, diff --git a/Indicators/TextAlignment Sample/TextAlignment Sample/TextAlignment Sample.cs b/Indicators/TextAlignment Sample/TextAlignment Sample/TextAlignment Sample.cs index 03c5bbb..46cc6c5 100644 --- a/Indicators/TextAlignment Sample/TextAlignment Sample/TextAlignment Sample.cs +++ b/Indicators/TextAlignment Sample/TextAlignment Sample/TextAlignment Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class TextAlignmentSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -28,7 +28,7 @@ protected override void Initialize() Width = 200 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = "Sample text", TextAlignment = TextAlignment diff --git a/Indicators/TextBlock Sample/TextBlock Sample/TextBlock Sample.cs b/Indicators/TextBlock Sample/TextBlock Sample/TextBlock Sample.cs index 4f42f62..cf9e8e7 100644 --- a/Indicators/TextBlock Sample/TextBlock Sample/TextBlock Sample.cs +++ b/Indicators/TextBlock Sample/TextBlock Sample/TextBlock Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class TextBlockSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -28,7 +28,7 @@ protected override void Initialize() Width = 200 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = Text, FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/TextBox Sample/TextBox Sample/TextBox Sample.cs b/Indicators/TextBox Sample/TextBox Sample/TextBox Sample.cs index 8f5a5f7..6e83102 100644 --- a/Indicators/TextBox Sample/TextBox Sample/TextBox Sample.cs +++ b/Indicators/TextBox Sample/TextBox Sample/TextBox Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class TextBoxSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - var textBox = new TextBox + var textBox = new TextBox { Text = "Enter text here...", FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/TextChangedEventArgs Sample/TextChangedEventArgs Sample/TextChangedEventArgs Sample.cs b/Indicators/TextChangedEventArgs Sample/TextChangedEventArgs Sample/TextChangedEventArgs Sample.cs index cfeb611..48625cc 100644 --- a/Indicators/TextChangedEventArgs Sample/TextChangedEventArgs Sample/TextChangedEventArgs Sample.cs +++ b/Indicators/TextChangedEventArgs Sample/TextChangedEventArgs Sample/TextChangedEventArgs Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class TextChangedEventArgsSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - var textBox = new TextBox + var textBox = new TextBox { Text = "Enter text here...", FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/TextTrimming Sample/TextTrimming Sample/TextTrimming Sample.cs b/Indicators/TextTrimming Sample/TextTrimming Sample/TextTrimming Sample.cs index f247388..2b6ccd2 100644 --- a/Indicators/TextTrimming Sample/TextTrimming Sample/TextTrimming Sample.cs +++ b/Indicators/TextTrimming Sample/TextTrimming Sample/TextTrimming Sample.cs @@ -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. @@ -22,7 +22,7 @@ public class TextTrimmingSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -31,7 +31,7 @@ protected override void Initialize() Width = 100 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = Text, FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/TextWrapping Sample/TextWrapping Sample/TextWrapping Sample.cs b/Indicators/TextWrapping Sample/TextWrapping Sample/TextWrapping Sample.cs index 522bd16..2bb9707 100644 --- a/Indicators/TextWrapping Sample/TextWrapping Sample/TextWrapping Sample.cs +++ b/Indicators/TextWrapping Sample/TextWrapping Sample/TextWrapping Sample.cs @@ -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. @@ -22,7 +22,7 @@ public class TextWrappingSample : Indicator protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -31,7 +31,7 @@ protected override void Initialize() Width = 100 }; - stackPanel.AddChild(new TextBlock + stackPanel.AddChild(new TextBlock { Text = Text, FontWeight = FontWeight.ExtraBold, diff --git a/Indicators/Thickness Sample/Thickness Sample/Thickness Sample.cs b/Indicators/Thickness Sample/Thickness Sample/Thickness Sample.cs index c7e4745..5c62d3a 100644 --- a/Indicators/Thickness Sample/Thickness Sample/Thickness Sample.cs +++ b/Indicators/Thickness Sample/Thickness Sample/Thickness Sample.cs @@ -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. @@ -16,7 +16,7 @@ public class ThicknessSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -24,7 +24,7 @@ protected override void Initialize() Opacity = 0.6 }; - var rectangle = new Rectangle + var rectangle = new Rectangle { StrokeColor = Color.Blue, FillColor = Color.Red, diff --git a/Indicators/Tick Sample/Tick Sample/Tick Sample.cs b/Indicators/Tick Sample/Tick Sample/Tick Sample.cs index ad1548e..ad0c2e9 100644 --- a/Indicators/Tick Sample/Tick Sample/Tick Sample.cs +++ b/Indicators/Tick Sample/Tick Sample/Tick Sample.cs @@ -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. diff --git a/Indicators/Ticks Sample/Ticks Sample/Ticks Sample.cs b/Indicators/Ticks Sample/Ticks Sample/Ticks Sample.cs index 82cafb4..f2daf68 100644 --- a/Indicators/Ticks Sample/Ticks Sample/Ticks Sample.cs +++ b/Indicators/Ticks Sample/Ticks Sample/Ticks Sample.cs @@ -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. diff --git a/Indicators/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample.cs b/Indicators/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample.cs index 5ffd351..3034e5f 100644 --- a/Indicators/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample.cs +++ b/Indicators/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample/TicksHistoryLoadedEventArgs Sample.cs @@ -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. diff --git a/Indicators/TicksTickEventArgs Sample/TicksTickEventArgs Sample/TicksTickEventArgs Sample.cs b/Indicators/TicksTickEventArgs Sample/TicksTickEventArgs Sample/TicksTickEventArgs Sample.cs index 6c0aa8f..26f6000 100644 --- a/Indicators/TicksTickEventArgs Sample/TicksTickEventArgs Sample/TicksTickEventArgs Sample.cs +++ b/Indicators/TicksTickEventArgs Sample/TicksTickEventArgs Sample/TicksTickEventArgs Sample.cs @@ -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. diff --git a/Indicators/TimeFrame Sample/TimeFrame Sample/TimeFrame Sample.cs b/Indicators/TimeFrame Sample/TimeFrame Sample/TimeFrame Sample.cs index c7ada91..b02c7a2 100644 --- a/Indicators/TimeFrame Sample/TimeFrame Sample/TimeFrame Sample.cs +++ b/Indicators/TimeFrame Sample/TimeFrame Sample/TimeFrame Sample.cs @@ -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. diff --git a/Indicators/TimeSeries Sample/TimeSeries Sample/TimeSeries Sample.cs b/Indicators/TimeSeries Sample/TimeSeries Sample/TimeSeries Sample.cs index f0f437e..a93a348 100644 --- a/Indicators/TimeSeries Sample/TimeSeries Sample/TimeSeries Sample.cs +++ b/Indicators/TimeSeries Sample/TimeSeries Sample/TimeSeries Sample.cs @@ -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. diff --git a/Indicators/TimeZone Sample/TimeZone Sample/TimeZone Sample.cs b/Indicators/TimeZone Sample/TimeZone Sample/TimeZone Sample.cs index eb3cfc7..5260bf8 100644 --- a/Indicators/TimeZone Sample/TimeZone Sample/TimeZone Sample.cs +++ b/Indicators/TimeZone Sample/TimeZone Sample/TimeZone Sample.cs @@ -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. diff --git a/Indicators/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample.cs b/Indicators/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample.cs index f2d9147..2c64490 100644 --- a/Indicators/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample.cs +++ b/Indicators/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample/ToggleButtonEventArgs Sample.cs @@ -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. @@ -18,7 +18,7 @@ public class ToggleButtonEventArgsSample : Indicator { protected override void Initialize() { - var stackPanel = new StackPanel + var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Center, @@ -28,7 +28,7 @@ protected override void Initialize() for (int i = 0; i < 5; i++) { - var toggleButton = new ToggleButton + var toggleButton = new ToggleButton { Text = "Toggle Button #" + i + " Unchecked", Margin = 10 diff --git a/Indicators/TradingSession Sample/TradingSession Sample/TradingSession Sample.cs b/Indicators/TradingSession Sample/TradingSession Sample/TradingSession Sample.cs index ce10234..4badea2 100644 --- a/Indicators/TradingSession Sample/TradingSession Sample/TradingSession Sample.cs +++ b/Indicators/TradingSession Sample/TradingSession Sample/TradingSession Sample.cs @@ -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. @@ -32,7 +32,7 @@ public class TradingSessionSample : Indicator protected override void Initialize() { - var grid = new Grid(6, 2) + var grid = new Grid(6, 2) { BackgroundColor = Color.Gold, Opacity = 0.6, @@ -49,20 +49,20 @@ protected override void Initialize() _symbol = UseCurrentSymbol ? Symbol : Symbols.GetSymbol(OtherSymbolName); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Symbol Info", Style = style, HorizontalAlignment = HorizontalAlignment.Center }, 0, 0, 1, 2); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Open", Style = style }, 1, 0); - _timeTillOpenTextBlock = new TextBlock + _timeTillOpenTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillOpen().ToString(), Style = style @@ -70,13 +70,13 @@ protected override void Initialize() grid.AddChild(_timeTillOpenTextBlock, 1, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Time Till Close", Style = style }, 2, 0); - _timeTillCloseTextBlock = new TextBlock + _timeTillCloseTextBlock = new TextBlock { Text = _symbol.MarketHours.TimeTillClose().ToString(), Style = style @@ -84,13 +84,13 @@ protected override void Initialize() grid.AddChild(_timeTillCloseTextBlock, 2, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Is Opened", Style = style }, 3, 0); - _isOpenedTextBlock = new TextBlock + _isOpenedTextBlock = new TextBlock { Text = _symbol.MarketHours.IsOpened().ToString(), Style = style @@ -98,19 +98,19 @@ protected override void Initialize() grid.AddChild(_isOpenedTextBlock, 3, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Sessions #", Style = style }, 4, 0); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = _symbol.MarketHours.Sessions.Count.ToString(), Style = style }, 4, 1); - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = "Trading Session Week Days", Style = style @@ -124,7 +124,7 @@ protected override void Initialize() weekDays = iSession == 0 ? currentSessionWeekDays : string.Format("{0}, {1}", weekDays, currentSessionWeekDays); } - grid.AddChild(new TextBlock + grid.AddChild(new TextBlock { Text = weekDays, Style = style diff --git a/Indicators/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample.cs b/Indicators/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample.cs index b832708..3e5b425 100644 --- a/Indicators/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample.cs +++ b/Indicators/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample/UserTimeOffsetChangedEventArgs Sample.cs @@ -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. diff --git a/Indicators/VerticalAlignment Sample/VerticalAlignment Sample/VerticalAlignment Sample.cs b/Indicators/VerticalAlignment Sample/VerticalAlignment Sample/VerticalAlignment Sample.cs index b35e607..69766db 100644 --- a/Indicators/VerticalAlignment Sample/VerticalAlignment Sample/VerticalAlignment Sample.cs +++ b/Indicators/VerticalAlignment Sample/VerticalAlignment Sample/VerticalAlignment Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class VerticalAlignmentSample : Indicator protected override void Initialize() { - var textBlock = new TextBlock + var textBlock = new TextBlock { Text = string.Format("Alignment: {0}", VerticalAlignment), VerticalAlignment = VerticalAlignment, diff --git a/Indicators/Watchlist Sample/Watchlist Sample/Watchlist Sample.cs b/Indicators/Watchlist Sample/Watchlist Sample/Watchlist Sample.cs index 2ca712b..4d2baff 100644 --- a/Indicators/Watchlist Sample/Watchlist Sample/Watchlist Sample.cs +++ b/Indicators/Watchlist Sample/Watchlist Sample/Watchlist Sample.cs @@ -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. diff --git a/Indicators/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample.cs b/Indicators/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample.cs index 665401b..0a2da44 100644 --- a/Indicators/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample.cs +++ b/Indicators/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample/WatchlistAddedEventArgs Sample.cs @@ -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. diff --git a/Indicators/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample.cs b/Indicators/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample.cs index 8b1f3ef..4eee808 100644 --- a/Indicators/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample.cs +++ b/Indicators/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample/WatchlistRemovedEventArgs Sample.cs @@ -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. diff --git a/Indicators/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample.cs b/Indicators/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample.cs index 21d4eca..ddd289d 100644 --- a/Indicators/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample.cs +++ b/Indicators/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample/WatchlistRenamedEventArgs Sample.cs @@ -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. diff --git a/Indicators/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample.cs b/Indicators/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample.cs index 191c3b7..1a9a38f 100644 --- a/Indicators/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample.cs +++ b/Indicators/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample/WatchlistSymbolAddedEventArgs Sample.cs @@ -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. diff --git a/Indicators/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample.cs b/Indicators/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample.cs index 9277b96..cb782c2 100644 --- a/Indicators/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample.cs +++ b/Indicators/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample/WatchlistSymbolRemovedEventArgs Sample.cs @@ -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. diff --git a/Indicators/Watchlists Sample/Watchlists Sample/Watchlists Sample.cs b/Indicators/Watchlists Sample/Watchlists Sample/Watchlists Sample.cs index dd62397..d0eb91f 100644 --- a/Indicators/Watchlists Sample/Watchlists Sample/Watchlists Sample.cs +++ b/Indicators/Watchlists Sample/Watchlists Sample/Watchlists Sample.cs @@ -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. diff --git a/Indicators/WrapPanel Sample/WrapPanel Sample/WrapPanel Sample.cs b/Indicators/WrapPanel Sample/WrapPanel Sample/WrapPanel Sample.cs index d875d59..c9011e9 100644 --- a/Indicators/WrapPanel Sample/WrapPanel Sample/WrapPanel Sample.cs +++ b/Indicators/WrapPanel Sample/WrapPanel Sample/WrapPanel Sample.cs @@ -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. @@ -19,7 +19,7 @@ public class WrapPanelSample : Indicator protected override void Initialize() { - var wrapPanel = new WrapPanel + var wrapPanel = new WrapPanel { BackgroundColor = Color.Gold, HorizontalAlignment = HorizontalAlignment.Center, @@ -31,7 +31,7 @@ protected override void Initialize() for (int i = 0; i < 10; i++) { - wrapPanel.AddChild(new TextBlock + wrapPanel.AddChild(new TextBlock { Text = "Text", Margin = 5, diff --git a/Plugins/ASP Section Example/ASP Section Example/ASP Section Example.cs b/Plugins/ASP Section Example/ASP Section Example/ASP Section Example.cs index c32a1be..549fe29 100644 --- a/Plugins/ASP Section Example/ASP Section Example/ASP Section Example.cs +++ b/Plugins/ASP Section Example/ASP Section Example/ASP Section Example.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This code 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. @@ -20,11 +20,11 @@ protected override void OnStart() block.Index = 2; block.Height = 500; block.IsExpanded = true; - - var webView = new WebView(); + + var webView = new WebView(); block.Child = webView; - + webView.NavigateAsync("https://ctrader.com/"); } - } + } } \ No newline at end of file diff --git a/Plugins/All placements/All placements/All placements.cs b/Plugins/All placements/All placements/All placements.cs index 81e5ed3..e285cee 100644 --- a/Plugins/All placements/All placements/All placements.cs +++ b/Plugins/All placements/All placements/All placements.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This code 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. @@ -19,9 +19,9 @@ namespace cAlgo.Plugins public class Allplacements : Plugin { const string WebViewUrl = "https://ctrader.com"; - + protected override void OnStart() - { + { var icon = new SvgIcon(@"
@@ -64,40 +64,41 @@ function updateValues(data){ "); - Account.Switched += Account_Switched; - } + Account.Switched += Account_Switched; + } - private void webView_NavigationCompleted(WebViewNavigationCompletedEventArgs obj) - { - UpdateAccountInfo(); - } + private void webView_NavigationCompleted(WebViewNavigationCompletedEventArgs obj) + { + UpdateAccountInfo(); + } - private void Account_Switched(AccountSwitchedEventArgs obj) - { - UpdateAccountInfo(); - } + private void Account_Switched(AccountSwitchedEventArgs obj) + { + UpdateAccountInfo(); + } - private void webView_WebMessageReceived(WebViewWebMessageReceivedEventArgs args) + private void webView_WebMessageReceived(WebViewWebMessageReceivedEventArgs args) + { + if (args.Message == @"""close all message""") + { + foreach (var position in Positions) { - if (args.Message == @"""close all message""") - { - foreach (var position in Positions) - { - position.Close(); - } - } + position.Close(); } + } + } - private void UpdateAccountInfo() - { - var data = new { - ctid = Account.UserId, - account = Account.Number, - broker = Account.BrokerName, - }; - var dataJson = System.Text.Json.JsonSerializer.Serialize(data); - - webView.ExecuteScript("updateValues(" + dataJson +")"); - } - } + private void UpdateAccountInfo() + { + var data = new + { + ctid = Account.UserId, + account = Account.Number, + broker = Account.BrokerName, + }; + var dataJson = System.Text.Json.JsonSerializer.Serialize(data); + + webView.ExecuteScript("updateValues(" + dataJson + ")"); + } + } } \ No newline at end of file diff --git a/Plugins/Order by Margin/Order by Margin/Order by Margin.cs b/Plugins/Order by Margin/Order by Margin/Order by Margin.cs index 43613d0..769aa18 100644 --- a/Plugins/Order by Margin/Order by Margin/Order by Margin.cs +++ b/Plugins/Order by Margin/Order by Margin/Order by Margin.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This code 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. @@ -18,17 +18,17 @@ namespace cAlgo.Plugins [Plugin(AccessRights = AccessRights.None)] public class OrderByMargin : Plugin { - TextBlock availableMarginTextBlock = new TextBlock(); - TextBlock quantityToTradeTextBlock = new TextBlock(); + TextBlock availableMarginTextBlock = new TextBlock(); + TextBlock quantityToTradeTextBlock = new TextBlock(); ViewModel viewModel = new ViewModel(); TextBox tradeableMarginTextBox; - + protected override void OnStart() { viewModel.Changed += viewModel_Changed; - + AddControls(); - + Positions.Opened += Positions_Opened; Positions.Closed += Positions_Closed; Positions.Modified += Positions_Modified; @@ -54,7 +54,7 @@ private void AddControls() var block = Asp.SymbolTab.AddBlock("New Order by Margin"); block.IsExpanded = true; block.IsDetachable = false; - block.Index = 1; + block.Index = 1; block.Height = 150; var rootStackPanel = new StackPanel { Margin = new Thickness(10) }; @@ -96,18 +96,18 @@ private void AddControls() volumeStackPanel.AddChild(quantityToTradeTextBlock); volumeStackPanel.AddChild(new TextBlock { Text = " Lots" }); rootStackPanel.AddChild(volumeStackPanel); - - var tradeButtons = new StackPanel{Orientation = Orientation.Horizontal, Margin = new Thickness(10), HorizontalAlignment = HorizontalAlignment.Center}; + + var tradeButtons = new StackPanel { Orientation = Orientation.Horizontal, Margin = new Thickness(10), HorizontalAlignment = HorizontalAlignment.Center }; tradeButtons.AddChild(CreateTradeButton("Sell", Styles.CreateSellButtonStyle(), TradeType.Sell)); tradeButtons.AddChild(CreateTradeButton("Buy", Styles.CreateBuyButtonStyle(), TradeType.Buy)); rootStackPanel.AddChild(tradeButtons); block.Child = rootStackPanel; } - + private Button CreateTradeButton(string text, Style style, TradeType tradeType) { - var tradeButton = new Button + var tradeButton = new Button { Text = text, Style = style, @@ -129,10 +129,10 @@ private void increaseMarginButton_Click(ButtonClickEventArgs obj) { var symbol = Asp.SymbolTab.Symbol; var leverage = Math.Min(symbol.DynamicLeverage[0].Leverage, Account.PreciseLeverage); - + if (viewModel.Quantity > symbol.VolumeInUnitsMax / symbol.LotSize) return; - + viewModel.Quantity += symbol.VolumeInUnitsMin / symbol.LotSize; RecalculateMargin(viewModel.Quantity); } @@ -141,16 +141,16 @@ private void decreaseMarginButton_Click(ButtonClickEventArgs obj) { var symbol = Asp.SymbolTab.Symbol; var leverage = Math.Min(symbol.DynamicLeverage[0].Leverage, Account.PreciseLeverage); - + if (viewModel.Quantity <= symbol.VolumeInUnitsMin / symbol.LotSize) return; - + viewModel.Quantity -= symbol.VolumeInUnitsMin / symbol.LotSize; RecalculateMargin(viewModel.Quantity); } private void viewModel_Changed() - { + { availableMarginTextBlock.Text = Math.Floor(viewModel.AvailableMargin).ToString() + " " + Account.Asset.Name; quantityToTradeTextBlock.Text = Math.Round(viewModel.Quantity, 2).ToString(); tradeableMarginTextBox.Text = viewModel.MarginToTrade.ToString(); @@ -175,28 +175,28 @@ private void UpdateAvailableMargin() { viewModel.AvailableMargin = Account.FreeMargin; } - + private void SetMaximumMargin() { var symbol = Asp.SymbolTab.Symbol; - var leverage = Math.Min(symbol.DynamicLeverage[0].Leverage, Account.PreciseLeverage); + var leverage = Math.Min(symbol.DynamicLeverage[0].Leverage, Account.PreciseLeverage); var volume = Account.Asset.Convert(symbol.BaseAsset, Account.FreeMargin * leverage); var tradeableVolume = symbol.NormalizeVolumeInUnits(volume, RoundingMode.Down); - - viewModel.Quantity = tradeableVolume / symbol.LotSize; + + viewModel.Quantity = tradeableVolume / symbol.LotSize; viewModel.MarginToTrade = symbol.BaseAsset.Convert(Account.Asset, tradeableVolume / leverage); } private void RecalculateMargin(double quantity) { var symbol = Asp.SymbolTab.Symbol; var leverage = Math.Min(symbol.DynamicLeverage[0].Leverage, Account.PreciseLeverage); - + var volume = quantity * symbol.LotSize; var margin = symbol.BaseAsset.Convert(Account.Asset, volume / leverage); viewModel.MarginToTrade = Math.Floor(margin); } - } - + } + public static class Styles { public static Style CreateBuyButtonStyle() @@ -219,57 +219,57 @@ private static Style CreateButtonStyle(Color color, Color hoverColor) style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.DarkTheme); style.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.LightTheme); style.Set(ControlProperty.Width, 100); - style.Set(ControlProperty.Margin, new Thickness(5,0,5,0)); + style.Set(ControlProperty.Margin, new Thickness(5, 0, 5, 0)); return style; } } - - + + class ViewModel { private double _availableMargin; public double AvailableMargin { - get { return _availableMargin; } - set + get { return _availableMargin; } + set { if (value == _availableMargin) return; _availableMargin = value; - + Changed?.Invoke(); } } - + private double _quantity; public double Quantity { - get { return _quantity; } - set + get { return _quantity; } + set { if (value == _quantity) return; _quantity = value; - + Changed?.Invoke(); } } - + private double _marginToTrade; public double MarginToTrade { - get { return _marginToTrade; } - set + get { return _marginToTrade; } + set { if (value == _marginToTrade) return; _marginToTrade = value; - + Changed?.Invoke(); } } - - + + public event Action Changed; } } \ No newline at end of file diff --git a/README.md b/README.md index 9b1cad5..72d3530 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# cTrader Automate API Samples -cBot / Indicator Samples of cTrader Automate API +# cTrader Algo API Samples +cBot / Indicator Samples of cTrader Algo API diff --git a/Robots/Accelerator Oscillator Sample/Accelerator Oscillator Sample/Accelerator Oscillator Sample.cs b/Robots/Accelerator Oscillator Sample/Accelerator Oscillator Sample/Accelerator Oscillator Sample.cs index e9bffd4..08a1403 100644 --- a/Robots/Accelerator Oscillator Sample/Accelerator Oscillator Sample/Accelerator Oscillator Sample.cs +++ b/Robots/Accelerator Oscillator Sample/Accelerator Oscillator Sample/Accelerator Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Accumulative Swing Index Sample/Accumulative Swing Index Sample/Accumulative Swing Index Sample.cs b/Robots/Accumulative Swing Index Sample/Accumulative Swing Index Sample/Accumulative Swing Index Sample.cs index 3afe36c..19cf9ff 100644 --- a/Robots/Accumulative Swing Index Sample/Accumulative Swing Index Sample/Accumulative Swing Index Sample.cs +++ b/Robots/Accumulative Swing Index Sample/Accumulative Swing Index Sample/Accumulative Swing Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -30,10 +30,10 @@ public class AccumulativeSwingIndexSample : Robot [Parameter("Label", DefaultValue = "AccumulativeSwingIndexSample")] public string Label { get; set; } - + [Parameter("Limit Move Value", DefaultValue = 12, Group = "Accumulative Swing Index", MinValue = 0)] public int LimitMoveValue { get; set; } - + public Position[] BotPositions { get diff --git a/Robots/Alligator Sample/Alligator Sample/Alligator Sample.cs b/Robots/Alligator Sample/Alligator Sample/Alligator Sample.cs index 30e3570..9ddfc29 100644 --- a/Robots/Alligator Sample/Alligator Sample/Alligator Sample.cs +++ b/Robots/Alligator Sample/Alligator Sample/Alligator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Aroon Sample/Aroon Sample/Aroon Sample.cs b/Robots/Aroon Sample/Aroon Sample/Aroon Sample.cs index a990203..6b98738 100644 --- a/Robots/Aroon Sample/Aroon Sample/Aroon Sample.cs +++ b/Robots/Aroon Sample/Aroon Sample/Aroon Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample.cs b/Robots/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample.cs index a4c6b3d..ad7f4de 100644 --- a/Robots/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample.cs +++ b/Robots/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample/Average Directional Movement Index Rating Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -33,7 +33,7 @@ public class AverageDirectionalMovementIndexRatingSample : Robot [Parameter("Periods", DefaultValue = 14, Group = "Average Directional Movement Index Ratin")] public int Periods { get; set; } - + [Parameter("ADXR Level", DefaultValue = 25, Group = "Average Directional Movement Index Ratin")] public int ADXRLevel { get; set; } diff --git a/Robots/Average True Range Sample/Average True Range Sample/Average True Range Sample.cs b/Robots/Average True Range Sample/Average True Range Sample/Average True Range Sample.cs index a0f3478..ace4bbf 100644 --- a/Robots/Average True Range Sample/Average True Range Sample/Average True Range Sample.cs +++ b/Robots/Average True Range Sample/Average True Range Sample/Average True Range Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Awesome Oscillator Sample/Awesome Oscillator Sample/Awesome Oscillator Sample.cs b/Robots/Awesome Oscillator Sample/Awesome Oscillator Sample/Awesome Oscillator Sample.cs index e66eda8..4a4cc0c 100644 --- a/Robots/Awesome Oscillator Sample/Awesome Oscillator Sample/Awesome Oscillator Sample.cs +++ b/Robots/Awesome Oscillator Sample/Awesome Oscillator Sample/Awesome Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Bollinger Bands Sample/Bollinger Bands Sample/Bollinger Bands Sample.cs b/Robots/Bollinger Bands Sample/Bollinger Bands Sample/Bollinger Bands Sample.cs index a9c0221..0d4fa79 100644 --- a/Robots/Bollinger Bands Sample/Bollinger Bands Sample/Bollinger Bands Sample.cs +++ b/Robots/Bollinger Bands Sample/Bollinger Bands Sample/Bollinger Bands Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Center Of Gravity Sample/Center Of Gravity Sample/Center Of Gravity Sample.cs b/Robots/Center Of Gravity Sample/Center Of Gravity Sample/Center Of Gravity Sample.cs index 5eb1773..0395aa7 100644 --- a/Robots/Center Of Gravity Sample/Center Of Gravity Sample/Center Of Gravity Sample.cs +++ b/Robots/Center Of Gravity Sample/Center Of Gravity Sample/Center Of Gravity Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Chaikin Money Flow Sample/Chaikin Money Flow Sample/Chaikin Money Flow Sample.cs b/Robots/Chaikin Money Flow Sample/Chaikin Money Flow Sample/Chaikin Money Flow Sample.cs index a85376c..216ce65 100644 --- a/Robots/Chaikin Money Flow Sample/Chaikin Money Flow Sample/Chaikin Money Flow Sample.cs +++ b/Robots/Chaikin Money Flow Sample/Chaikin Money Flow Sample/Chaikin Money Flow Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Chaikin Volatility Sample/Chaikin Volatility Sample/Chaikin Volatility Sample.cs b/Robots/Chaikin Volatility Sample/Chaikin Volatility Sample/Chaikin Volatility Sample.cs index 52eec95..0e5dd52 100644 --- a/Robots/Chaikin Volatility Sample/Chaikin Volatility Sample/Chaikin Volatility Sample.cs +++ b/Robots/Chaikin Volatility Sample/Chaikin Volatility Sample/Chaikin Volatility Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Close All On Market Close Sample/Close All On Market Close Sample/Close All On Market Close Sample.cs b/Robots/Close All On Market Close Sample/Close All On Market Close Sample/Close All On Market Close Sample.cs index eb61542..e49c4dd 100644 --- a/Robots/Close All On Market Close Sample/Close All On Market Close Sample/Close All On Market Close Sample.cs +++ b/Robots/Close All On Market Close Sample/Close All On Market Close Sample/Close All On Market Close Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Commodity Channel Index Sample/Commodity Channel Index Sample/Commodity Channel Index Sample.cs b/Robots/Commodity Channel Index Sample/Commodity Channel Index Sample/Commodity Channel Index Sample.cs index a6d96f2..6b57c15 100644 --- a/Robots/Commodity Channel Index Sample/Commodity Channel Index Sample/Commodity Channel Index Sample.cs +++ b/Robots/Commodity Channel Index Sample/Commodity Channel Index Sample/Commodity Channel Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Custom Fitness Functions/Custom Fitness Functions/Custom Fitness Functions.cs b/Robots/Custom Fitness Functions/Custom Fitness Functions/Custom Fitness Functions.cs index 9470485..649397b 100644 --- a/Robots/Custom Fitness Functions/Custom Fitness Functions/Custom Fitness Functions.cs +++ b/Robots/Custom Fitness Functions/Custom Fitness Functions/Custom Fitness Functions.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -82,7 +82,7 @@ private double VolumeInUnits protected override double GetFitness(GetFitnessArgs args) { - if(args.TotalTrades > 20 && args.MaxEquityDrawdownPercentages < 50) + if (args.TotalTrades > 20 && args.MaxEquityDrawdownPercentages < 50) { return Math.Pow(args.WinningTrades + 1, 2) / (args.LosingTrades + 1); } diff --git a/Robots/Cyber Cycle Sample/Cyber Cycle Sample/Cyber Cycle Sample.cs b/Robots/Cyber Cycle Sample/Cyber Cycle Sample/Cyber Cycle Sample.cs index b02f3a4..33aa3c5 100644 --- a/Robots/Cyber Cycle Sample/Cyber Cycle Sample/Cyber Cycle Sample.cs +++ b/Robots/Cyber Cycle Sample/Cyber Cycle Sample/Cyber Cycle Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample.cs b/Robots/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample.cs index 2cdc6b1..19b8975 100644 --- a/Robots/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample.cs +++ b/Robots/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample/Detrended Price Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Directional Movement System Sample/Directional Movement System Sample/Directional Movement System Sample.cs b/Robots/Directional Movement System Sample/Directional Movement System Sample/Directional Movement System Sample.cs index 116d6e4..5f4753e 100644 --- a/Robots/Directional Movement System Sample/Directional Movement System Sample/Directional Movement System Sample.cs +++ b/Robots/Directional Movement System Sample/Directional Movement System Sample/Directional Movement System Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Donchian Channel Sample/Donchian Channel Sample/Donchian Channel Sample.cs b/Robots/Donchian Channel Sample/Donchian Channel Sample/Donchian Channel Sample.cs index 5563cf1..5f6ff8e 100644 --- a/Robots/Donchian Channel Sample/Donchian Channel Sample/Donchian Channel Sample.cs +++ b/Robots/Donchian Channel Sample/Donchian Channel Sample/Donchian Channel Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Ease Of Movement Sample/Ease Of Movement Sample/Ease Of Movement Sample.cs b/Robots/Ease Of Movement Sample/Ease Of Movement Sample/Ease Of Movement Sample.cs index 09c4aed..47a0d18 100644 --- a/Robots/Ease Of Movement Sample/Ease Of Movement Sample/Ease Of Movement Sample.cs +++ b/Robots/Ease Of Movement Sample/Ease Of Movement Sample/Ease Of Movement Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Error Sample/Error Sample/Error Sample.cs b/Robots/Error Sample/Error Sample/Error Sample.cs index d75d108..a5b34bd 100644 --- a/Robots/Error Sample/Error Sample/Error Sample.cs +++ b/Robots/Error Sample/Error Sample/Error Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Exponential Moving Average Sample/Exponential Moving Average Sample/Exponential Moving Average Sample.cs b/Robots/Exponential Moving Average Sample/Exponential Moving Average Sample/Exponential Moving Average Sample.cs index f58e492..35d48c0 100644 --- a/Robots/Exponential Moving Average Sample/Exponential Moving Average Sample/Exponential Moving Average Sample.cs +++ b/Robots/Exponential Moving Average Sample/Exponential Moving Average Sample/Exponential Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -45,7 +45,7 @@ public class ExponentialMovingAverageSample : Robot [Parameter("Source", Group = "Exponential Moving Average 2")] public DataSeries SourceSecond { get; set; } - + public Position[] BotPositions { get @@ -55,15 +55,15 @@ public Position[] BotPositions } protected override void OnStart() - { + { _volumeInUnits = Symbol.QuantityToVolumeInUnits(VolumeInLots); _fastExponentialMovingAverage = Indicators.ExponentialMovingAverage(SourceFirst, PeriodsFirst); - + _fastExponentialMovingAverage.Result.Line.Color = Color.Blue; _slowExponentialMovingAverage = Indicators.ExponentialMovingAverage(SourceSecond, PeriodsSecond); - + _slowExponentialMovingAverage.Result.Line.Color = Color.Red; } diff --git a/Robots/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample.cs b/Robots/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample.cs index c13ba01..018c001 100644 --- a/Robots/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample.cs +++ b/Robots/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample/Fractal Chaos Bands Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Fractals Sample/Fractals Sample/Fractals Sample.cs b/Robots/Fractals Sample/Fractals Sample/Fractals Sample.cs index 5357f27..648028f 100644 --- a/Robots/Fractals Sample/Fractals Sample/Fractals Sample.cs +++ b/Robots/Fractals Sample/Fractals Sample/Fractals Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/GetFitnessArgs Sample/GetFitnessArgs Sample/GetFitnessArgs Sample.cs b/Robots/GetFitnessArgs Sample/GetFitnessArgs Sample/GetFitnessArgs Sample.cs index 7e502fa..a7b5555 100644 --- a/Robots/GetFitnessArgs Sample/GetFitnessArgs Sample/GetFitnessArgs Sample.cs +++ b/Robots/GetFitnessArgs Sample/GetFitnessArgs Sample/GetFitnessArgs Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Grid/Grid/Grid.cs b/Robots/Grid/Grid/Grid.cs index d625e96..13e77b2 100644 --- a/Robots/Grid/Grid/Grid.cs +++ b/Robots/Grid/Grid/Grid.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -23,43 +23,43 @@ public class Grid : Robot { [Parameter("Volume (lots)", DefaultValue = 0.01, MinValue = 0.01, Step = 0.01)] public double VolumeInLots { get; set; } - + [Parameter("Trade Side")] public TradeType TradeType { get; set; } - + [Parameter("Step (pips)", DefaultValue = 5, MinValue = 0.1, Step = 0.1)] public double StepPips { get; set; } - + [Parameter("Target Profit", DefaultValue = 20)] public double TargetProfit { get; set; } - + private bool enoughMoney = true; protected override void OnStart() - { - if (GridPositions.Length == 0) - OpenPosition(); + { + if (GridPositions.Length == 0) + OpenPosition(); } protected override void OnTick() { if (GridPositions.Sum(p => p.NetProfit) >= TargetProfit) { - Print("Target profit is reached. Closing all grid positions"); - CloseGridPositions(); - Print("All grid positions are closed. Stopping cBot"); - Stop(); - } + Print("Target profit is reached. Closing all grid positions"); + CloseGridPositions(); + Print("All grid positions are closed. Stopping cBot"); + Stop(); + } if (GridPositions.Length > 0 && enoughMoney) { var lastGridPosition = GridPositions.OrderBy(p => p.Pips).Last(); var distance = CalculateDistanceInPips(lastGridPosition); - + if (distance >= StepPips) - OpenPosition(); + OpenPosition(); } } - + private Position[] GridPositions { get @@ -68,26 +68,26 @@ private Position[] GridPositions .Where(p => p.SymbolName == SymbolName && p.TradeType == TradeType) .ToArray(); } - } - + } + private double CalculateDistanceInPips(Position position) { if (position.TradeType == TradeType.Buy) - return (position.EntryPrice - Symbol.Ask) / Symbol.PipSize; + return (position.EntryPrice - Symbol.Ask) / Symbol.PipSize; else return (Symbol.Bid - position.EntryPrice) / Symbol.PipSize; } - + private void OpenPosition() - { + { var result = ExecuteMarketOrder(TradeType, SymbolName, Symbol.QuantityToVolumeInUnits(VolumeInLots), "Grid"); if (result.Error == ErrorCode.NoMoney) { enoughMoney = false; - Print("Not enough money to open additional positions"); + Print("Not enough money to open additional positions"); } } - + private void CloseGridPositions() { while (GridPositions.Length > 0) @@ -97,6 +97,6 @@ private void CloseGridPositions() ClosePosition(position); } } - } + } } } \ No newline at end of file diff --git a/Robots/High Minus Low Sample/High Minus Low Sample/High Minus Low Sample.cs b/Robots/High Minus Low Sample/High Minus Low Sample/High Minus Low Sample.cs index 4bf8782..3c280c2 100644 --- a/Robots/High Minus Low Sample/High Minus Low Sample/High Minus Low Sample.cs +++ b/Robots/High Minus Low Sample/High Minus Low Sample/High Minus Low Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -21,7 +21,7 @@ public class HighMinusLowSample : Robot [Parameter("Volume (Lots)", DefaultValue = 0.01)] public double VolumeInLots { get; set; } - + [Parameter("Stop Loss (Pips)", DefaultValue = 10, MaxValue = 100, MinValue = 1, Step = 1)] public double StopLossInPips { get; set; } diff --git a/Robots/Historical Volatility Sample/Historical Volatility Sample/Historical Volatility Sample.cs b/Robots/Historical Volatility Sample/Historical Volatility Sample/Historical Volatility Sample.cs index 94eca59..a080e80 100644 --- a/Robots/Historical Volatility Sample/Historical Volatility Sample/Historical Volatility Sample.cs +++ b/Robots/Historical Volatility Sample/Historical Volatility Sample/Historical Volatility Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Hull Moving Average Sample/Hull Moving Average Sample/Hull Moving Average Sample.cs b/Robots/Hull Moving Average Sample/Hull Moving Average Sample/Hull Moving Average Sample.cs index 587ec0c..caf3b58 100644 --- a/Robots/Hull Moving Average Sample/Hull Moving Average Sample/Hull Moving Average Sample.cs +++ b/Robots/Hull Moving Average Sample/Hull Moving Average Sample/Hull Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -59,7 +59,7 @@ protected override void OnStart() _fastHull = Indicators.HullMovingAverage(FastMaSource, FastMaPeriod); _slowHull = Indicators.HullMovingAverage(SlowMaSource, SlowMaPeriod); - + _fastHull.Result.Line.Color = Color.Blue; _slowHull.Result.Line.Color = Color.Red; } diff --git a/Robots/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample.cs b/Robots/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample.cs index 294d86b..46e2b96 100644 --- a/Robots/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample.cs +++ b/Robots/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample/Ichimoku Kinko Hyo Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Keltner Channels Sample/Keltner Channels Sample/Keltner Channels Sample.cs b/Robots/Keltner Channels Sample/Keltner Channels Sample/Keltner Channels Sample.cs index c86620c..99d3f8d 100644 --- a/Robots/Keltner Channels Sample/Keltner Channels Sample/Keltner Channels Sample.cs +++ b/Robots/Keltner Channels Sample/Keltner Channels Sample/Keltner Channels Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Linear Regression Forecast Sample/Linear Regression Forecast Sample/Linear Regression Forecast Sample.cs b/Robots/Linear Regression Forecast Sample/Linear Regression Forecast Sample/Linear Regression Forecast Sample.cs index ff75566..3aa73fc 100644 --- a/Robots/Linear Regression Forecast Sample/Linear Regression Forecast Sample/Linear Regression Forecast Sample.cs +++ b/Robots/Linear Regression Forecast Sample/Linear Regression Forecast Sample/Linear Regression Forecast Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Linear Regression Intercept Sample/Linear Regression Intercept Sample/Linear Regression Intercept Sample.cs b/Robots/Linear Regression Intercept Sample/Linear Regression Intercept Sample/Linear Regression Intercept Sample.cs index 61099bb..fc14eb0 100644 --- a/Robots/Linear Regression Intercept Sample/Linear Regression Intercept Sample/Linear Regression Intercept Sample.cs +++ b/Robots/Linear Regression Intercept Sample/Linear Regression Intercept Sample/Linear Regression Intercept Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Linear Regression R Squared Sample/Linear Regression R Squared Sample/Linear Regression R Squared Sample.cs b/Robots/Linear Regression R Squared Sample/Linear Regression R Squared Sample/Linear Regression R Squared Sample.cs index 3398aa4..dc54fc6 100644 --- a/Robots/Linear Regression R Squared Sample/Linear Regression R Squared Sample/Linear Regression R Squared Sample.cs +++ b/Robots/Linear Regression R Squared Sample/Linear Regression R Squared Sample/Linear Regression R Squared Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Linear Regression Slope Sample/Linear Regression Slope Sample/Linear Regression Slope Sample.cs b/Robots/Linear Regression Slope Sample/Linear Regression Slope Sample/Linear Regression Slope Sample.cs index b0c2f00..578b523 100644 --- a/Robots/Linear Regression Slope Sample/Linear Regression Slope Sample/Linear Regression Slope Sample.cs +++ b/Robots/Linear Regression Slope Sample/Linear Regression Slope Sample/Linear Regression Slope Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Macd Cross Over Sample/Macd Cross Over Sample/Macd Cross Over Sample.cs b/Robots/Macd Cross Over Sample/Macd Cross Over Sample/Macd Cross Over Sample.cs index 2384a31..8250707 100644 --- a/Robots/Macd Cross Over Sample/Macd Cross Over Sample/Macd Cross Over Sample.cs +++ b/Robots/Macd Cross Over Sample/Macd Cross Over Sample/Macd Cross Over Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -31,7 +31,7 @@ public class MacdCrossOverSample : Robot [Parameter("Label", DefaultValue = "MacdCrossOverSample")] public string Label { get; set; } - + [Parameter("Source", Group = "Macd Crossover")] public DataSeries Source { get; set; } diff --git a/Robots/Macd Histogram Sample/Macd Histogram Sample/Macd Histogram Sample.cs b/Robots/Macd Histogram Sample/Macd Histogram Sample/Macd Histogram Sample.cs index a76fc51..7de7a3a 100644 --- a/Robots/Macd Histogram Sample/Macd Histogram Sample/Macd Histogram Sample.cs +++ b/Robots/Macd Histogram Sample/Macd Histogram Sample/Macd Histogram Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Mass Index Sample/Mass Index Sample/Mass Index Sample.cs b/Robots/Mass Index Sample/Mass Index Sample/Mass Index Sample.cs index e9b62d8..5a95358 100644 --- a/Robots/Mass Index Sample/Mass Index Sample/Mass Index Sample.cs +++ b/Robots/Mass Index Sample/Mass Index Sample/Mass Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Median Price Sample/Median Price Sample/Median Price Sample.cs b/Robots/Median Price Sample/Median Price Sample/Median Price Sample.cs index 978961f..f5331de 100644 --- a/Robots/Median Price Sample/Median Price Sample/Median Price Sample.cs +++ b/Robots/Median Price Sample/Median Price Sample/Median Price Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Momentum Oscillator Sample/Momentum Oscillator Sample/Momentum Oscillator Sample.cs b/Robots/Momentum Oscillator Sample/Momentum Oscillator Sample/Momentum Oscillator Sample.cs index 0e829d3..01f44a9 100644 --- a/Robots/Momentum Oscillator Sample/Momentum Oscillator Sample/Momentum Oscillator Sample.cs +++ b/Robots/Momentum Oscillator Sample/Momentum Oscillator Sample/Momentum Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Money Flow Index Sample/Money Flow Index Sample/Money Flow Index Sample.cs b/Robots/Money Flow Index Sample/Money Flow Index Sample/Money Flow Index Sample.cs index f255c69..66e52a5 100644 --- a/Robots/Money Flow Index Sample/Money Flow Index Sample/Money Flow Index Sample.cs +++ b/Robots/Money Flow Index Sample/Money Flow Index Sample/Money Flow Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Moving Average Sample/Moving Average Sample/Moving Average Sample.cs b/Robots/Moving Average Sample/Moving Average Sample/Moving Average Sample.cs index a7b93a5..a4ace06 100644 --- a/Robots/Moving Average Sample/Moving Average Sample/Moving Average Sample.cs +++ b/Robots/Moving Average Sample/Moving Average Sample/Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -64,8 +64,8 @@ protected override void OnStart() _volumeInUnits = Symbol.QuantityToVolumeInUnits(VolumeInLots); _fastMa = Indicators.MovingAverage(FastMaSource, FastMaPeriod, FastMaType); - _slowMa = Indicators.MovingAverage(SlowMaSource, SlowMaPeriod, SlowMaType); - + _slowMa = Indicators.MovingAverage(SlowMaSource, SlowMaPeriod, SlowMaType); + _fastMa.Result.Line.Color = Color.Blue; _slowMa.Result.Line.Color = Color.Red; } diff --git a/Robots/On Balance Volume Sample/On Balance Volume Sample/On Balance Volume Sample.cs b/Robots/On Balance Volume Sample/On Balance Volume Sample/On Balance Volume Sample.cs index 3f0c035..6ad955a 100644 --- a/Robots/On Balance Volume Sample/On Balance Volume Sample/On Balance Volume Sample.cs +++ b/Robots/On Balance Volume Sample/On Balance Volume Sample/On Balance Volume Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Parabolic SAR Sample/Parabolic SAR Sample/Parabolic SAR Sample.cs b/Robots/Parabolic SAR Sample/Parabolic SAR Sample/Parabolic SAR Sample.cs index 6dbe7a7..a42133c 100644 --- a/Robots/Parabolic SAR Sample/Parabolic SAR Sample/Parabolic SAR Sample.cs +++ b/Robots/Parabolic SAR Sample/Parabolic SAR Sample/Parabolic SAR Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Partial Close Sample/Partial Close Sample/Partial Close Sample.cs b/Robots/Partial Close Sample/Partial Close Sample/Partial Close Sample.cs index 5717418..b41887d 100644 --- a/Robots/Partial Close Sample/Partial Close Sample/Partial Close Sample.cs +++ b/Robots/Partial Close Sample/Partial Close Sample/Partial Close Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Pending Order Cancelation Sample/Pending Order Cancelation Sample/Pending Order Cancelation Sample.cs b/Robots/Pending Order Cancelation Sample/Pending Order Cancelation Sample/Pending Order Cancelation Sample.cs index 4c1ad03..03e5285 100644 --- a/Robots/Pending Order Cancelation Sample/Pending Order Cancelation Sample/Pending Order Cancelation Sample.cs +++ b/Robots/Pending Order Cancelation Sample/Pending Order Cancelation Sample/Pending Order Cancelation Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Pending Order Events/Pending Order Events/Pending Order Events.cs b/Robots/Pending Order Events/Pending Order Events/Pending Order Events.cs index 348d389..c81fc4e 100644 --- a/Robots/Pending Order Events/Pending Order Events/Pending Order Events.cs +++ b/Robots/Pending Order Events/Pending Order Events/Pending Order Events.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Pending Order Modification Sample/Pending Order Modification Sample/Pending Order Modification Sample.cs b/Robots/Pending Order Modification Sample/Pending Order Modification Sample/Pending Order Modification Sample.cs index 4f4c1e3..5789320 100644 --- a/Robots/Pending Order Modification Sample/Pending Order Modification Sample/Pending Order Modification Sample.cs +++ b/Robots/Pending Order Modification Sample/Pending Order Modification Sample/Pending Order Modification Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Pending Order Placing Sample/Pending Order Placing Sample/Pending Order Placing Sample.cs b/Robots/Pending Order Placing Sample/Pending Order Placing Sample/Pending Order Placing Sample.cs index f9a40e6..b02af6c 100644 --- a/Robots/Pending Order Placing Sample/Pending Order Placing Sample/Pending Order Placing Sample.cs +++ b/Robots/Pending Order Placing Sample/Pending Order Placing Sample/Pending Order Placing Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample.cs b/Robots/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample.cs index bd531d1..a40e12a 100644 --- a/Robots/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample.cs +++ b/Robots/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample/PendingOrderCancellationReason Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/PendingOrders Sample/PendingOrders Sample/PendingOrders Sample.cs b/Robots/PendingOrders Sample/PendingOrders Sample/PendingOrders Sample.cs index 8562407..38937c4 100644 --- a/Robots/PendingOrders Sample/PendingOrders Sample/PendingOrders Sample.cs +++ b/Robots/PendingOrders Sample/PendingOrders Sample/PendingOrders Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample.cs b/Robots/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample.cs index 60dfb8f..5db2509 100644 --- a/Robots/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample.cs +++ b/Robots/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample/Polynomial Regression Channels Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Position Bars Passed Sample/Position Bars Passed Sample/Position Bars Passed Sample.cs b/Robots/Position Bars Passed Sample/Position Bars Passed Sample/Position Bars Passed Sample.cs index 32e80b4..2974b29 100644 --- a/Robots/Position Bars Passed Sample/Position Bars Passed Sample/Position Bars Passed Sample.cs +++ b/Robots/Position Bars Passed Sample/Position Bars Passed Sample/Position Bars Passed Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Position Closing Sample/Position Closing Sample/Position Closing Sample.cs b/Robots/Position Closing Sample/Position Closing Sample/Position Closing Sample.cs index 27adf5d..562eaf2 100644 --- a/Robots/Position Closing Sample/Position Closing Sample/Position Closing Sample.cs +++ b/Robots/Position Closing Sample/Position Closing Sample/Position Closing Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Position Events Sample/Position Events Sample/Position Events Sample.cs b/Robots/Position Events Sample/Position Events Sample/Position Events Sample.cs index 19ce02c..a71d37f 100644 --- a/Robots/Position Events Sample/Position Events Sample/Position Events Sample.cs +++ b/Robots/Position Events Sample/Position Events Sample/Position Events Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Position Execution Sample/Position Execution Sample/Position Execution Sample.cs b/Robots/Position Execution Sample/Position Execution Sample/Position Execution Sample.cs index 818eac3..884befe 100644 --- a/Robots/Position Execution Sample/Position Execution Sample/Position Execution Sample.cs +++ b/Robots/Position Execution Sample/Position Execution Sample/Position Execution Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Position Modification Sample/Position Modification Sample/Position Modification Sample.cs b/Robots/Position Modification Sample/Position Modification Sample/Position Modification Sample.cs index 95b02f4..d39a188 100644 --- a/Robots/Position Modification Sample/Position Modification Sample/Position Modification Sample.cs +++ b/Robots/Position Modification Sample/Position Modification Sample/Position Modification Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/PositionCloseReason Sample/PositionCloseReason Sample/PositionCloseReason Sample.cs b/Robots/PositionCloseReason Sample/PositionCloseReason Sample/PositionCloseReason Sample.cs index 2d3023c..d10fa3c 100644 --- a/Robots/PositionCloseReason Sample/PositionCloseReason Sample/PositionCloseReason Sample.cs +++ b/Robots/PositionCloseReason Sample/PositionCloseReason Sample/PositionCloseReason Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample.cs b/Robots/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample.cs index 6808dc3..8497f06 100644 --- a/Robots/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample.cs +++ b/Robots/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample/PositionModifiedEventArgs Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Price Oscillator Sample/Price Oscillator Sample/Price Oscillator Sample.cs b/Robots/Price Oscillator Sample/Price Oscillator Sample/Price Oscillator Sample.cs index e77e6ea..22edb92 100644 --- a/Robots/Price Oscillator Sample/Price Oscillator Sample/Price Oscillator Sample.cs +++ b/Robots/Price Oscillator Sample/Price Oscillator Sample/Price Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Price ROC Sample/Price ROC Sample/Price ROC Sample.cs b/Robots/Price ROC Sample/Price ROC Sample/Price ROC Sample.cs index e944f5e..c4043f8 100644 --- a/Robots/Price ROC Sample/Price ROC Sample/Price ROC Sample.cs +++ b/Robots/Price ROC Sample/Price ROC Sample/Price ROC Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Price Volume Trend Sample/Price Volume Trend Sample/Price Volume Trend Sample.cs b/Robots/Price Volume Trend Sample/Price Volume Trend Sample/Price Volume Trend Sample.cs index 79c33bf..d7065a0 100644 --- a/Robots/Price Volume Trend Sample/Price Volume Trend Sample/Price Volume Trend Sample.cs +++ b/Robots/Price Volume Trend Sample/Price Volume Trend Sample/Price Volume Trend Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Rainbow Oscillator Sample/Rainbow Oscillator Sample/Rainbow Oscillator Sample.cs b/Robots/Rainbow Oscillator Sample/Rainbow Oscillator Sample/Rainbow Oscillator Sample.cs index abf683e..c4f2819 100644 --- a/Robots/Rainbow Oscillator Sample/Rainbow Oscillator Sample/Rainbow Oscillator Sample.cs +++ b/Robots/Rainbow Oscillator Sample/Rainbow Oscillator Sample/Rainbow Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Range Strategy Example/Range Strategy Example/Range Strategy Example.cs b/Robots/Range Strategy Example/Range Strategy Example/Range Strategy Example.cs index c7f72f7..b84e2ef 100644 --- a/Robots/Range Strategy Example/Range Strategy Example/Range Strategy Example.cs +++ b/Robots/Range Strategy Example/Range Strategy Example/Range Strategy Example.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -23,28 +23,28 @@ public class RangeStrategyExample : Robot { [Parameter(DefaultValue = 100000)] public double Volume { get; set; } - + [Parameter(DefaultValue = 20)] public double StopLoss { get; set; } - + [Parameter(DefaultValue = 20)] public double TakeProfit { get; set; } protected override void OnStart() { - + } protected override void OnBarClosed() { - if(Bars.Last(0).Close > Bars.Last(0).Open && Bars.Last(1).Close < Bars.Last(1).Open && + if (Bars.Last(0).Close > Bars.Last(0).Open && Bars.Last(1).Close < Bars.Last(1).Open && Bars.Last(0).Close > Bars.Last(1).Open) { ExecuteMarketOrder(TradeType.Buy, SymbolName, Volume, InstanceId, StopLoss, TakeProfit); } - - - if(Bars.Last(0).Close < Bars.Last(0).Open && Bars.Last(1).Close > Bars.Last(1).Open && + + + if (Bars.Last(0).Close < Bars.Last(0).Open && Bars.Last(1).Close > Bars.Last(1).Open && Bars.Last(0).Close < Bars.Last(1).Open) { ExecuteMarketOrder(TradeType.Sell, SymbolName, Volume, InstanceId, StopLoss, TakeProfit); diff --git a/Robots/RefreshData Sample/RefreshData Sample/RefreshData Sample.cs b/Robots/RefreshData Sample/RefreshData Sample/RefreshData Sample.cs index 60d97b8..abf326c 100644 --- a/Robots/RefreshData Sample/RefreshData Sample/RefreshData Sample.cs +++ b/Robots/RefreshData Sample/RefreshData Sample/RefreshData Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Relative Strength Index Sample/Relative Strength Index Sample/Relative Strength Index Sample.cs b/Robots/Relative Strength Index Sample/Relative Strength Index Sample/Relative Strength Index Sample.cs index c455423..c31cc6b 100644 --- a/Robots/Relative Strength Index Sample/Relative Strength Index Sample/Relative Strength Index Sample.cs +++ b/Robots/Relative Strength Index Sample/Relative Strength Index Sample/Relative Strength Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Running Mode Sample/Running Mode Sample/Running Mode Sample.cs b/Robots/Running Mode Sample/Running Mode Sample/Running Mode Sample.cs index 81ca92a..84314ed 100644 --- a/Robots/Running Mode Sample/Running Mode Sample/Running Mode Sample.cs +++ b/Robots/Running Mode Sample/Running Mode Sample/Running Mode Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Simple Moving Average Sample/Simple Moving Average Sample/Simple Moving Average Sample.cs b/Robots/Simple Moving Average Sample/Simple Moving Average Sample/Simple Moving Average Sample.cs index b42d065..d5336fe 100644 --- a/Robots/Simple Moving Average Sample/Simple Moving Average Sample/Simple Moving Average Sample.cs +++ b/Robots/Simple Moving Average Sample/Simple Moving Average Sample/Simple Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -59,7 +59,7 @@ protected override void OnStart() _fastSimpleMovingAverage = Indicators.SimpleMovingAverage(FastMaSource, FastMaPeriod); _slowSimpleMovingAverage = Indicators.SimpleMovingAverage(SlowMaSource, SlowMaPeriod); - + _fastSimpleMovingAverage.Result.Line.Color = Color.Blue; _slowSimpleMovingAverage.Result.Line.Color = Color.Red; } diff --git a/Robots/Standard Deviation Sample/Standard Deviation Sample/Standard Deviation Sample.cs b/Robots/Standard Deviation Sample/Standard Deviation Sample/Standard Deviation Sample.cs index 35e6010..65094e0 100644 --- a/Robots/Standard Deviation Sample/Standard Deviation Sample/Standard Deviation Sample.cs +++ b/Robots/Standard Deviation Sample/Standard Deviation Sample/Standard Deviation Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -41,7 +41,7 @@ public class StandardDeviationSample : Robot public DataSeries SourceMovingAverage { get; set; } [Parameter("Periods Moving Average", DefaultValue = 14, Group = "Moving Average", MinValue = 2)] - public int PeriodsMovingAverage{ get; set; } + public int PeriodsMovingAverage { get; set; } public Position[] BotPositions diff --git a/Robots/Stochastic Oscillator Sample/Stochastic Oscillator Sample/Stochastic Oscillator Sample.cs b/Robots/Stochastic Oscillator Sample/Stochastic Oscillator Sample/Stochastic Oscillator Sample.cs index f5850f0..212a2a5 100644 --- a/Robots/Stochastic Oscillator Sample/Stochastic Oscillator Sample/Stochastic Oscillator Sample.cs +++ b/Robots/Stochastic Oscillator Sample/Stochastic Oscillator Sample/Stochastic Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/StopTriggerMethod Sample/StopTriggerMethod Sample/StopTriggerMethod Sample.cs b/Robots/StopTriggerMethod Sample/StopTriggerMethod Sample/StopTriggerMethod Sample.cs index 1a3773e..cb7e25a 100644 --- a/Robots/StopTriggerMethod Sample/StopTriggerMethod Sample/StopTriggerMethod Sample.cs +++ b/Robots/StopTriggerMethod Sample/StopTriggerMethod Sample/StopTriggerMethod Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Supertrend Sample/Supertrend Sample/Supertrend Sample.cs b/Robots/Supertrend Sample/Supertrend Sample/Supertrend Sample.cs index 20b11bd..21befef 100644 --- a/Robots/Supertrend Sample/Supertrend Sample/Supertrend Sample.cs +++ b/Robots/Supertrend Sample/Supertrend Sample/Supertrend Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Swing Index Sample/Swing Index Sample/Swing Index Sample.cs b/Robots/Swing Index Sample/Swing Index Sample/Swing Index Sample.cs index 7bcba41..e45bc2c 100644 --- a/Robots/Swing Index Sample/Swing Index Sample/Swing Index Sample.cs +++ b/Robots/Swing Index Sample/Swing Index Sample/Swing Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -31,7 +31,7 @@ public class SwingIndexSample : Robot [Parameter("Label", DefaultValue = "SwingIndexSample")] public string Label { get; set; } - [Parameter("Limit Move Value", DefaultValue = 12, Group ="Swing Index", MinValue = 1)] + [Parameter("Limit Move Value", DefaultValue = 12, Group = "Swing Index", MinValue = 1)] public int LimitMoveValue { get; set; } diff --git a/Robots/Time Series Moving Average Sample/Time Series Moving Average Sample/Time Series Moving Average Sample.cs b/Robots/Time Series Moving Average Sample/Time Series Moving Average Sample/Time Series Moving Average Sample.cs index 8919628..5c6845b 100644 --- a/Robots/Time Series Moving Average Sample/Time Series Moving Average Sample/Time Series Moving Average Sample.cs +++ b/Robots/Time Series Moving Average Sample/Time Series Moving Average Sample/Time Series Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -60,7 +60,7 @@ protected override void OnStart() _fastTimeSeriesMovingAverage = Indicators.TimeSeriesMovingAverage(FastMaSource, FastMaPeriod); _slowTimeSeriesMovingAverage = Indicators.TimeSeriesMovingAverage(SlowMaSource, SlowMaPeriod); - + _fastTimeSeriesMovingAverage.Result.Line.Color = Color.Blue; _slowTimeSeriesMovingAverage.Result.Line.Color = Color.Red; } diff --git a/Robots/Timer Sample/Timer Sample/Timer Sample.cs b/Robots/Timer Sample/Timer Sample/Timer Sample.cs index f76395a..c2a5f17 100644 --- a/Robots/Timer Sample/Timer Sample/Timer Sample.cs +++ b/Robots/Timer Sample/Timer Sample/Timer Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Trade Volume Index Sample/Trade Volume Index Sample/Trade Volume Index Sample.cs b/Robots/Trade Volume Index Sample/Trade Volume Index Sample/Trade Volume Index Sample.cs index 6390206..827eecb 100644 --- a/Robots/Trade Volume Index Sample/Trade Volume Index Sample/Trade Volume Index Sample.cs +++ b/Robots/Trade Volume Index Sample/Trade Volume Index Sample/Trade Volume Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/TradeOperation Sample/TradeOperation Sample/TradeOperation Sample.cs b/Robots/TradeOperation Sample/TradeOperation Sample/TradeOperation Sample.cs index 34b2507..72f6945 100644 --- a/Robots/TradeOperation Sample/TradeOperation Sample/TradeOperation Sample.cs +++ b/Robots/TradeOperation Sample/TradeOperation Sample/TradeOperation Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/TradeResult Sample/TradeResult Sample/TradeResult Sample.cs b/Robots/TradeResult Sample/TradeResult Sample/TradeResult Sample.cs index 0f5e4c2..3073368 100644 --- a/Robots/TradeResult Sample/TradeResult Sample/TradeResult Sample.cs +++ b/Robots/TradeResult Sample/TradeResult Sample/TradeResult Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/TradeType Sample/TradeType Sample/TradeType Sample.cs b/Robots/TradeType Sample/TradeType Sample/TradeType Sample.cs index 8b13d5d..3199e5e 100644 --- a/Robots/TradeType Sample/TradeType Sample/TradeType Sample.cs +++ b/Robots/TradeType Sample/TradeType Sample/TradeType Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Triangular Moving Average Sample/Triangular Moving Average Sample/Triangular Moving Average Sample.cs b/Robots/Triangular Moving Average Sample/Triangular Moving Average Sample/Triangular Moving Average Sample.cs index 27c7e28..64417c0 100644 --- a/Robots/Triangular Moving Average Sample/Triangular Moving Average Sample/Triangular Moving Average Sample.cs +++ b/Robots/Triangular Moving Average Sample/Triangular Moving Average Sample/Triangular Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -35,7 +35,7 @@ public class TriangularMovingAverageSample : Robot [Parameter("Volume (Lots)", DefaultValue = 0.01, Group = "Trade")] public double VolumeInLots { get; set; } - + [Parameter("Stop Loss (Pips)", DefaultValue = 10, MaxValue = 100, MinValue = 1, Step = 1)] public double StopLossInPips { get; set; } @@ -59,7 +59,7 @@ protected override void OnStart() _fastTriangularMovingAverage = Indicators.TriangularMovingAverage(FastMaSource, FastMaPeriod); _slowTriangularMovingAverage = Indicators.TriangularMovingAverage(SlowMaSource, SlowMaPeriod); - + _fastTriangularMovingAverage.Result.Line.Color = Color.Blue; _slowTriangularMovingAverage.Result.Line.Color = Color.Red; } diff --git a/Robots/Trix Sample/Trix Sample/Trix Sample.cs b/Robots/Trix Sample/Trix Sample/Trix Sample.cs index 72ac730..4fffae8 100644 --- a/Robots/Trix Sample/Trix Sample/Trix Sample.cs +++ b/Robots/Trix Sample/Trix Sample/Trix Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/True Range Sample/True Range Sample/True Range Sample.cs b/Robots/True Range Sample/True Range Sample/True Range Sample.cs index 8bd647a..aa27f61 100644 --- a/Robots/True Range Sample/True Range Sample/True Range Sample.cs +++ b/Robots/True Range Sample/True Range Sample/True Range Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Typical Price Sample/Typical Price Sample/Typical Price Sample.cs b/Robots/Typical Price Sample/Typical Price Sample/Typical Price Sample.cs index 33f59a7..2005675 100644 --- a/Robots/Typical Price Sample/Typical Price Sample/Typical Price Sample.cs +++ b/Robots/Typical Price Sample/Typical Price Sample/Typical Price Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Ultimate Oscillator Sample/Ultimate Oscillator Sample/Ultimate Oscillator Sample.cs b/Robots/Ultimate Oscillator Sample/Ultimate Oscillator Sample/Ultimate Oscillator Sample.cs index 501d5fd..efabd0d 100644 --- a/Robots/Ultimate Oscillator Sample/Ultimate Oscillator Sample/Ultimate Oscillator Sample.cs +++ b/Robots/Ultimate Oscillator Sample/Ultimate Oscillator Sample/Ultimate Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample.cs b/Robots/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample.cs index 186e29a..b6fe6cd 100644 --- a/Robots/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample.cs +++ b/Robots/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample/Vertical Horizontal Filter Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Vidya Sample/Vidya Sample/Vidya Sample.cs b/Robots/Vidya Sample/Vidya Sample/Vidya Sample.cs index 909b93c..76baa09 100644 --- a/Robots/Vidya Sample/Vidya Sample/Vidya Sample.cs +++ b/Robots/Vidya Sample/Vidya Sample/Vidya Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -65,7 +65,7 @@ protected override void OnStart() _fastVidya = Indicators.Vidya(FastMaSource, FastMaPeriod, FastSigma); _slowVidya = Indicators.Vidya(SlowMaSource, SlowMaPeriod, SlowSigma); - + _fastVidya.Result.Line.Color = Color.Blue; _slowVidya.Result.Line.Color = Color.Red; } diff --git a/Robots/Volume Index Sample/Volume Index Sample/Volume Index Sample.cs b/Robots/Volume Index Sample/Volume Index Sample/Volume Index Sample.cs index b1a92be..1f35627 100644 --- a/Robots/Volume Index Sample/Volume Index Sample/Volume Index Sample.cs +++ b/Robots/Volume Index Sample/Volume Index Sample/Volume Index Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Volume Oscillator Sample/Volume Oscillator Sample/Volume Oscillator Sample.cs b/Robots/Volume Oscillator Sample/Volume Oscillator Sample/Volume Oscillator Sample.cs index dc50ec8..726b08d 100644 --- a/Robots/Volume Oscillator Sample/Volume Oscillator Sample/Volume Oscillator Sample.cs +++ b/Robots/Volume Oscillator Sample/Volume Oscillator Sample/Volume Oscillator Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Volume ROC Sample/Volume ROC Sample/Volume ROC Sample.cs b/Robots/Volume ROC Sample/Volume ROC Sample/Volume ROC Sample.cs index be179c6..848f92b 100644 --- a/Robots/Volume ROC Sample/Volume ROC Sample/Volume ROC Sample.cs +++ b/Robots/Volume ROC Sample/Volume ROC Sample/Volume ROC Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Weighted Close Sample/Weighted Close Sample/Weighted Close Sample.cs b/Robots/Weighted Close Sample/Weighted Close Sample/Weighted Close Sample.cs index 96827fe..2bb30cc 100644 --- a/Robots/Weighted Close Sample/Weighted Close Sample/Weighted Close Sample.cs +++ b/Robots/Weighted Close Sample/Weighted Close Sample/Weighted Close Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/Weighted Moving Average Sample/Weighted Moving Average Sample/Weighted Moving Average Sample.cs b/Robots/Weighted Moving Average Sample/Weighted Moving Average Sample/Weighted Moving Average Sample.cs index e2a1f56..733fb0a 100644 --- a/Robots/Weighted Moving Average Sample/Weighted Moving Average Sample/Weighted Moving Average Sample.cs +++ b/Robots/Weighted Moving Average Sample/Weighted Moving Average Sample/Weighted Moving Average Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -59,7 +59,7 @@ protected override void OnStart() _fastWeightedMovingAverage = Indicators.WeightedMovingAverage(FastMaSource, FastMaPeriod); _slowWeightedMovingAverage = Indicators.WeightedMovingAverage(SlowMaSource, SlowMaPeriod); - + _fastWeightedMovingAverage.Result.Line.Color = Color.Blue; _slowWeightedMovingAverage.Result.Line.Color = Color.Red; } diff --git a/Robots/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample.cs b/Robots/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample.cs index 42224a7..1622ed4 100644 --- a/Robots/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample.cs +++ b/Robots/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample/Welles Wilder Smoothing Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. @@ -59,7 +59,7 @@ protected override void OnStart() _fastWellesWilderSmoothing = Indicators.WellesWilderSmoothing(FastMaSource, FastMaPeriod); _slowWellesWilderSmoothing = Indicators.WellesWilderSmoothing(SlowMaSource, SlowMaPeriod); - + _fastWellesWilderSmoothing.Result.Line.Color = Color.Blue; _slowWellesWilderSmoothing.Result.Line.Color = Color.Red; } diff --git a/Robots/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample.cs b/Robots/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample.cs index 9143a60..1d4785b 100644 --- a/Robots/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample.cs +++ b/Robots/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample/Williams Accumulation Distribution Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. diff --git a/Robots/WilliamsPctR Sample/WilliamsPctR Sample/WilliamsPctR Sample.cs b/Robots/WilliamsPctR Sample/WilliamsPctR Sample/WilliamsPctR Sample.cs index 5dd72d0..1e57834 100644 --- a/Robots/WilliamsPctR Sample/WilliamsPctR Sample/WilliamsPctR Sample.cs +++ b/Robots/WilliamsPctR Sample/WilliamsPctR Sample/WilliamsPctR Sample.cs @@ -1,6 +1,6 @@ // ------------------------------------------------------------------------------------------------- // -// This code is a cTrader Automate API example. +// This code is a cTrader Algo API example. // // This cBot 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. From 45c66797b40ba9b33357f3ce9724c62318168919 Mon Sep 17 00:00:00 2001 From: eoseriki Date: Tue, 27 Aug 2024 14:16:16 +0300 Subject: [PATCH 10/15] CNT-731: Add cloud to indicator samples (#30) * CNT-731: Add cloud to indicator samples * CNT-731: Fixes --- Indicators/.samples.json | 6 +++ .../Bollinger Bands Cloud Sample.sln | 22 ++++++++ .../Bollinger Bands Cloud Sample.cs | 50 +++++++++++++++++++ .../Bollinger Bands Cloud Sample.csproj | 9 ++++ .../MA Cloud Sample/MA Cloud Sample.sln | 22 ++++++++ .../MA Cloud Sample/MA Cloud Sample.cs | 46 +++++++++++++++++ .../MA Cloud Sample/MA Cloud Sample.csproj | 9 ++++ 7 files changed, 164 insertions(+) create mode 100644 Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.sln create mode 100644 Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.cs create mode 100644 Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.csproj create mode 100644 Indicators/MA Cloud Sample/MA Cloud Sample.sln create mode 100644 Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.cs create mode 100644 Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.csproj diff --git a/Indicators/.samples.json b/Indicators/.samples.json index 8228c03..c65cb17 100644 --- a/Indicators/.samples.json +++ b/Indicators/.samples.json @@ -29,6 +29,9 @@ { "name": "BarsTickEventArgs Sample" }, + { + "name": "Bollinger Bands Cloud Sample" + }, { "name": "Bollinger Bands MTF Cloud Sample" }, @@ -272,6 +275,9 @@ { "name": "Line Style Sample" }, + { + "name": "MA Cloud Sample" + }, { "name": "Market Data Sample" }, diff --git a/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.sln b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.sln new file mode 100644 index 0000000..8217377 --- /dev/null +++ b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Bollinger Bands Cloud Sample", "Bollinger Bands Cloud Sample\Bollinger Bands Cloud Sample.csproj", "{d13ce943-9302-455b-9ec2-5e6a99b87f23}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {d13ce943-9302-455b-9ec2-5e6a99b87f23}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {d13ce943-9302-455b-9ec2-5e6a99b87f23}.Debug|Any CPU.Build.0 = Debug|Any CPU + {d13ce943-9302-455b-9ec2-5e6a99b87f23}.Release|Any CPU.ActiveCfg = Release|Any CPU + {d13ce943-9302-455b-9ec2-5e6a99b87f23}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.cs b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.cs new file mode 100644 index 0000000..0e1e554 --- /dev/null +++ b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.cs @@ -0,0 +1,50 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample indicator draws a cloud between the top and bottom bands of Bollinger Bands. +// +// For a detailed tutorial on creating this indicator, see this video: https://www.youtube.com/watch?v=AWqo0k0Rrag +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo +{ + [Indicator(AccessRights = AccessRights.None, IsOverlay = true)] + [Cloud("Top", "Bottom", Opacity = 0.2)] + + public class BollingerBandsCloud : Indicator + { + + [Output("Main", LineColor = "Yellow", PlotType = PlotType.Line, Thickness = 1)] + public IndicatorDataSeries Main { get; set; } + + [Output("Top", LineColor = "Red", PlotType = PlotType.Line, Thickness = 1)] + public IndicatorDataSeries Top { get; set; } + + [Output("Bottom", LineColor = "Red", PlotType = PlotType.Line, Thickness = 1)] + public IndicatorDataSeries Bottom { get; set; } + + private BollingerBands _bollingerBands; + + protected override void Initialize() + { + _bollingerBands = Indicators.BollingerBands(Bars.ClosePrices, 20, 2, MovingAverageType.Simple); + } + + public override void Calculate(int index) + { + Main[index] = _bollingerBands.Main[index]; + Top[index] = _bollingerBands.Top[index]; + Bottom[index] = _bollingerBands.Bottom[index]; + } + } +} \ No newline at end of file diff --git a/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.csproj b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Indicators/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample/Bollinger Bands Cloud Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Indicators/MA Cloud Sample/MA Cloud Sample.sln b/Indicators/MA Cloud Sample/MA Cloud Sample.sln new file mode 100644 index 0000000..9d1704f --- /dev/null +++ b/Indicators/MA Cloud Sample/MA Cloud Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MA Cloud Sample", "MA Cloud Sample\MA Cloud Sample.csproj", "{121fedb8-4ad2-4fd0-80dd-97ee82602d8d}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {121fedb8-4ad2-4fd0-80dd-97ee82602d8d}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {121fedb8-4ad2-4fd0-80dd-97ee82602d8d}.Debug|Any CPU.Build.0 = Debug|Any CPU + {121fedb8-4ad2-4fd0-80dd-97ee82602d8d}.Release|Any CPU.ActiveCfg = Release|Any CPU + {121fedb8-4ad2-4fd0-80dd-97ee82602d8d}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.cs b/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.cs new file mode 100644 index 0000000..df970e5 --- /dev/null +++ b/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.cs @@ -0,0 +1,46 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample indicator draws a green cloud for uptrends and a red cloud for downtrends on a Moving Average (MA) Crossover. +// +// For a detailed tutorial on creating this indicator, see this video: https://www.youtube.com/watch?v=AWqo0k0Rrag +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo +{ + [Indicator(AccessRights = AccessRights.None, IsOverlay = true)] + [Cloud("Fast", "Slow", Opacity = 0.2)] + public class MACloud : Indicator + { + [Output("Fast", LineColor = "Green", PlotType = PlotType.Line, Thickness = 1)] + public IndicatorDataSeries Fast { get; set; } + + [Output("Slow", LineColor = "Red", PlotType = PlotType.Line, Thickness = 1)] + public IndicatorDataSeries Slow { get; set; } + + SimpleMovingAverage _fastMA; + SimpleMovingAverage _slowMA; + + protected override void Initialize() + { + _fastMA = Indicators.SimpleMovingAverage(Bars.ClosePrices, 7); + _slowMA = Indicators.SimpleMovingAverage(Bars.ClosePrices, 13); + } + + public override void Calculate(int index) + { + Fast[index] = _fastMA.Result[index]; + Slow[index] = _slowMA.Result[index]; + } + } +} \ No newline at end of file diff --git a/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.csproj b/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Indicators/MA Cloud Sample/MA Cloud Sample/MA Cloud Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From 7668e8d895fda9ef78d76fde45e7fc7b1d3fe9e3 Mon Sep 17 00:00:00 2001 From: eoseriki Date: Tue, 27 Aug 2024 15:17:39 +0300 Subject: [PATCH 11/15] CNT-708-717-721 Algo samples (#31) --- Indicators/.samples.json | 3 + .../Trading Panel Sample.sln | 22 +++++ .../Trading Panel Sample.cs | 61 ++++++++++++ .../Trading Panel Sample.csproj | 9 ++ Robots/.samples.json | 9 ++ .../Web Sockets Sample/Web Sockets Sample.sln | 22 +++++ .../Web Sockets Sample/Web Sockets Sample.cs | 53 +++++++++++ .../Web Sockets Sample.csproj | 9 ++ .../cBot Adds Indicator Sample.sln | 22 +++++ .../cBot Adds Indicator Sample.cs | 93 +++++++++++++++++++ .../cBot Adds Indicator Sample.csproj | 9 ++ .../cBot Starts cBot Sample.sln | 22 +++++ .../cBot Starts cBot Sample.cs | 63 +++++++++++++ .../cBot Starts cBot Sample.csproj | 9 ++ 14 files changed, 406 insertions(+) create mode 100644 Indicators/Trading Panel Sample/Trading Panel Sample.sln create mode 100644 Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.cs create mode 100644 Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.csproj create mode 100644 Robots/Web Sockets Sample/Web Sockets Sample.sln create mode 100644 Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.cs create mode 100644 Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.csproj create mode 100644 Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln create mode 100644 Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs create mode 100644 Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj create mode 100644 Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln create mode 100644 Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs create mode 100644 Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj diff --git a/Indicators/.samples.json b/Indicators/.samples.json index c65cb17..4550c97 100644 --- a/Indicators/.samples.json +++ b/Indicators/.samples.json @@ -428,6 +428,9 @@ { "name": "ToggleButtonEventArgs Sample" }, + { + "name": "Trading Panel Sample" + }, { "name": "TradingFromIndicators Sample" }, diff --git a/Indicators/Trading Panel Sample/Trading Panel Sample.sln b/Indicators/Trading Panel Sample/Trading Panel Sample.sln new file mode 100644 index 0000000..5dcbb1f --- /dev/null +++ b/Indicators/Trading Panel Sample/Trading Panel Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Trading Panel Sample", "Trading Panel Sample\Trading Panel Sample.csproj", "{b7a7a3f2-374a-41e2-97d3-a27390202a75}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {b7a7a3f2-374a-41e2-97d3-a27390202a75}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {b7a7a3f2-374a-41e2-97d3-a27390202a75}.Debug|Any CPU.Build.0 = Debug|Any CPU + {b7a7a3f2-374a-41e2-97d3-a27390202a75}.Release|Any CPU.ActiveCfg = Release|Any CPU + {b7a7a3f2-374a-41e2-97d3-a27390202a75}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.cs b/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.cs new file mode 100644 index 0000000..cdb1171 --- /dev/null +++ b/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.cs @@ -0,0 +1,61 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample indicator displays a simple trading panel. +// +// For a detailed tutorial on creating this indicator, see this video: https://www.youtube.com/watch?v=IJu7zxl5DA0 +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo +{ + [Indicator(AccessRights = AccessRights.None, IsOverlay = true)] + public class TradingPanel : Indicator + { + protected override void Initialize() + { + var tradeButtonBuy = new Button + { + Text = "Buy", + ForegroundColor = Color.White, + BackgroundColor = Color.Green, + Height = 25, + Width = 75, + Margin = 2 + }; + + tradeButtonBuy.Click += args => ExecuteMarketOrderAsync(TradeType.Buy, SymbolName, 1000); + + var tradeButtonSell = new Button + { + Text = "Sell", + ForegroundColor = Color.White, + BackgroundColor = Color.Red, + Height = 25, + Width = 75, + Margin = 2 + }; + tradeButtonSell.Click += args => ExecuteMarketOrderAsync(TradeType.Sell, SymbolName, 1000); + + var grid = new Grid(1, 2); + grid.AddChild(tradeButtonBuy, 0,0); + grid.AddChild(tradeButtonSell, 0, 1); + Chart.AddControl(grid); + } + + public override void Calculate(int index) + { + // Calculate value at specified index + // Result[index] = + } + } +} \ No newline at end of file diff --git a/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.csproj b/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Indicators/Trading Panel Sample/Trading Panel Sample/Trading Panel Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Robots/.samples.json b/Robots/.samples.json index 740ec5d..af224c8 100644 --- a/Robots/.samples.json +++ b/Robots/.samples.json @@ -38,6 +38,12 @@ { "name": "Bollinger Bands Sample" }, + { + "name": "cBots Adds Indicator Sample" + }, + { + "name": "cBots Starts cBot Sample" + }, { "name": "Center Of Gravity Sample" }, @@ -299,6 +305,9 @@ { "name": "Volume ROC Sample" }, + { + "name": "Web Sockets Sample" + }, { "name": "WebSocket Sample" }, diff --git a/Robots/Web Sockets Sample/Web Sockets Sample.sln b/Robots/Web Sockets Sample/Web Sockets Sample.sln new file mode 100644 index 0000000..94dc2d2 --- /dev/null +++ b/Robots/Web Sockets Sample/Web Sockets Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Web Sockets Sample", "Web Sockets Sample\Web Sockets Sample.csproj", "{cd5f4d41-2fe3-40da-b9b2-389ea0689fc4}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {cd5f4d41-2fe3-40da-b9b2-389ea0689fc4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {cd5f4d41-2fe3-40da-b9b2-389ea0689fc4}.Debug|Any CPU.Build.0 = Debug|Any CPU + {cd5f4d41-2fe3-40da-b9b2-389ea0689fc4}.Release|Any CPU.ActiveCfg = Release|Any CPU + {cd5f4d41-2fe3-40da-b9b2-389ea0689fc4}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.cs b/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.cs new file mode 100644 index 0000000..f86c35f --- /dev/null +++ b/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.cs @@ -0,0 +1,53 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample cBot subscribes to a symbol price feed and streams the prices. +// +// For a detailed tutorial on creating this cBot, see this video: https://www.youtube.com/watch?v=y5ARwEEXSLI +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.None, AddIndicators = true)] + public class WebSocketsExample : Robot + { + private WebSocketClient _webSocketClient = new WebSocketClient(); + private readonly Uri _targetUri = new Uri("wss://marketdata.tradermade.com/feedadv"); + + protected override void OnStart() + { + _webSocketClient.Connect(_targetUri); + + _webSocketClient.TextReceived += _webSocketClient_TextReceived; + + var data = "{\"userKey\":\"PasteStreamingKeyHere\", \"symbol\":\"EURUSD\"}"; + + _webSocketClient.Send(data); + } + + private void _webSocketClient_TextReceived(WebSocketClientTextReceivedEventArgs obj) + { + Print(obj.Text.Replace("{", "").Replace("}", "").ToString()); + } + + protected override void OnTick() + { + // Handle price updates here + } + + protected override void OnStop() + { + _webSocketClient.Close(WebSocketClientCloseStatus.NormalClosure); + } + } +} \ No newline at end of file diff --git a/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.csproj b/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/Web Sockets Sample/Web Sockets Sample/Web Sockets Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln new file mode 100644 index 0000000..dc26e63 --- /dev/null +++ b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cBot Adds Indicator Sample", "cBot Adds Indicator Sample\cBot Adds Indicator Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs new file mode 100644 index 0000000..92265c5 --- /dev/null +++ b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs @@ -0,0 +1,93 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample cBot adds two moving averages for trading to a chart. +// +// For a detailed tutorial on creating this cBot, see this video: https://www.youtube.com/watch?v=DUzdEt30OSE +// +// ------------------------------------------------------------------------------------------------- + + +using cAlgo.API; +using cAlgo.API.Indicators; + +namespace cAlgo +{ + [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None, AddIndicators = true)] + public class SampleTrendcBot : Robot + { + [Parameter("Quantity (Lots)", Group = "Volume", DefaultValue = 1, MinValue = 0.01, Step = 0.01)] + public double Quantity { get; set; } + + [Parameter("MA Type", Group = "Moving Average")] + public MovingAverageType MAType { get; set; } + + [Parameter("Source", Group = "Moving Average")] + public DataSeries SourceSeries { get; set; } + + [Parameter("Slow Periods", Group = "Moving Average", DefaultValue = 10)] + public int SlowPeriods { get; set; } + + [Parameter("Fast Periods", Group = "Moving Average", DefaultValue = 5)] + public int FastPeriods { get; set; } + + private MovingAverage slowMa; + private MovingAverage fastMa; + private const string label = "Sample Trend cBot"; + + ChartIndicator _indicator1; + ChartIndicator _indicator2; + + protected override void OnStart() + { + fastMa = Indicators.MovingAverage(SourceSeries, FastPeriods, MAType); + slowMa = Indicators.MovingAverage(SourceSeries, SlowPeriods, MAType); + + _indicator1 = Chart.Indicators.Add("Simple Moving Average", SourceSeries, FastPeriods, MAType); + _indicator2 = Chart.Indicators.Add("Simple Moving Average", SourceSeries, SlowPeriods, MAType); + + _indicator1.Lines[0].Color = Color.Red; + _indicator1.Lines[0].Thickness = 3; + } + + protected override void OnBarClosed() + { + Chart.Indicators.Remove(_indicator1); + Chart.Indicators.Remove(_indicator2); + } + + protected override void OnTick() + { + var longPosition = Positions.Find(label, SymbolName, TradeType.Buy); + var shortPosition = Positions.Find(label, SymbolName, TradeType.Sell); + + var currentSlowMa = slowMa.Result.Last(0); + var currentFastMa = fastMa.Result.Last(0); + var previousSlowMa = slowMa.Result.Last(1); + var previousFastMa = fastMa.Result.Last(1); + + if (previousSlowMa > previousFastMa && currentSlowMa <= currentFastMa && longPosition == null) + { + if (shortPosition != null) + ClosePosition(shortPosition); + + ExecuteMarketOrder(TradeType.Buy, SymbolName, VolumeInUnits, label); + } + else if (previousSlowMa < previousFastMa && currentSlowMa >= currentFastMa && shortPosition == null) + { + if (longPosition != null) + ClosePosition(longPosition); + + ExecuteMarketOrder(TradeType.Sell, SymbolName, VolumeInUnits, label); + } + } + + private double VolumeInUnits + { + get { return Symbol.QuantityToVolumeInUnits(Quantity); } + } + } +} \ No newline at end of file diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln new file mode 100644 index 0000000..400d7b2 --- /dev/null +++ b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cBot Starts cBot Sample", "cBot Starts cBot Sample\cBot Starts cBot Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Debug|Any CPU.Build.0 = Debug|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Release|Any CPU.ActiveCfg = Release|Any CPU + {1751be77-fe78-4e12-b558-7fb418ed6b44}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs new file mode 100644 index 0000000..1cbd613 --- /dev/null +++ b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs @@ -0,0 +1,63 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This sample cBot adds and starts two other cBots based on a certain logic. +// +// For a detailed tutorial on creating this cBot, see this video: https://www.youtube.com/watch?v=DUzdEt30OSE +// +// ------------------------------------------------------------------------------------------------- + + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.None, AddIndicators = true)] + public class AddcBots : Robot + { + + ChartRobot _robot1; + ChartRobot _robot2; + + protected override void OnStart() + { + _robot1 = Chart.Robots.Add("Sample Trend cBot", 0.01, MovingAverageType.Simple, Bars.ClosePrices, 10, 5); + _robot2 = Chart.Robots.Add("Sample Trend cBot", 0.01, MovingAverageType.Simple, Bars.ClosePrices, 12, 7); + + Chart.Robots.RobotStarted += ChartRobots_RobotStarted; + } + + private void ChartRobots_RobotStarted(ChartRobotStartedEventArgs obj) + { + Print ("Robot Started"); + + } + + protected override void OnBarClosed() + { + if (_robot1.State == RobotState.Stopped) + { + _robot1.Start(); + _robot2.Stop(); + } + + else if (_robot1.State == RobotState.Running) + { + _robot2.Start(); + _robot1.Stop(); + } + } + + protected override void OnStop() + { + // Handle cBot stop here + } + } +} \ No newline at end of file diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From 9aa534cadb40e19ff5f692d60e131d6c11156832 Mon Sep 17 00:00:00 2001 From: eoseriki Date: Tue, 27 Aug 2024 15:19:04 +0300 Subject: [PATCH 12/15] CNT-663: Add Compilation Robot (#29) --- Robots/.samples.json | 3 ++ .../Compilation Robot/Compilation Robot.sln | 22 +++++++++++ .../Compilation Robot/Compilation Robot.cs | 38 +++++++++++++++++++ .../Compilation Robot.csproj | 9 +++++ 4 files changed, 72 insertions(+) create mode 100644 Robots/Compilation Robot/Compilation Robot.sln create mode 100644 Robots/Compilation Robot/Compilation Robot/Compilation Robot.cs create mode 100644 Robots/Compilation Robot/Compilation Robot/Compilation Robot.csproj diff --git a/Robots/.samples.json b/Robots/.samples.json index af224c8..efa7390 100644 --- a/Robots/.samples.json +++ b/Robots/.samples.json @@ -65,6 +65,9 @@ { "name": "Commodity Channel Index Sample" }, + { + "name": "Compilation Robot" + }, { "name": "CoordinatesConversion Sample" }, diff --git a/Robots/Compilation Robot/Compilation Robot.sln b/Robots/Compilation Robot/Compilation Robot.sln new file mode 100644 index 0000000..913398c --- /dev/null +++ b/Robots/Compilation Robot/Compilation Robot.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Compilation Robot", "Compilation Robot\Compilation Robot.csproj", "{569816c4-6ab8-4c81-aa59-b13056da93b1}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {569816c4-6ab8-4c81-aa59-b13056da93b1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {569816c4-6ab8-4c81-aa59-b13056da93b1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {569816c4-6ab8-4c81-aa59-b13056da93b1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {569816c4-6ab8-4c81-aa59-b13056da93b1}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/Compilation Robot/Compilation Robot/Compilation Robot.cs b/Robots/Compilation Robot/Compilation Robot/Compilation Robot.cs new file mode 100644 index 0000000..6076972 --- /dev/null +++ b/Robots/Compilation Robot/Compilation Robot/Compilation Robot.cs @@ -0,0 +1,38 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example cBot generates and saves algorithms by compiling .csproj files. +// +// ------------------------------------------------------------------------------------------------- + + + + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.FullAccess)] + public class CompilationRobot : Robot + { + + protected override void OnStart() + { + CompilationOptions options = new CompilationOptions + { + IncludeSourceCode = true, + OutputAlgoFilePath = @"C:\Users\{preferred path}\NameOfAlgo.algo" + }; + + CompilationResult resultSync = Compiler.Compile(@"C:\Users\{path to project}\NameOfCbot.csproj", options); + Print(resultSync.Succeeded); + } + } +} diff --git a/Robots/Compilation Robot/Compilation Robot/Compilation Robot.csproj b/Robots/Compilation Robot/Compilation Robot/Compilation Robot.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/Compilation Robot/Compilation Robot/Compilation Robot.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From 2bdd6f1af765f8d3449cb749e47eb476ca982ac7 Mon Sep 17 00:00:00 2001 From: eoseriki Date: Tue, 27 Aug 2024 15:42:43 +0300 Subject: [PATCH 13/15] Fix cBot samples (#32) --- Robots/.samples.json | 12 ++++++------ .../Add Indicator Sample.sln} | 2 +- .../Add Indicator Sample/Add Indicator Sample.cs} | 0 .../Add Indicator Sample.csproj} | 0 .../Start cBot Sample.sln} | 2 +- .../Start cBot Sample/Start cBot Sample.cs} | 0 .../Start cBot Sample/Start cBot Sample.csproj} | 0 7 files changed, 8 insertions(+), 8 deletions(-) rename Robots/{cBot Starts cBot Sample/cBot Starts cBot Sample.sln => Add Indicator Sample/Add Indicator Sample.sln} (82%) rename Robots/{cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs => Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.cs} (100%) rename Robots/{cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj => Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.csproj} (100%) rename Robots/{cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln => Start cBot Sample/Start cBot Sample.sln} (81%) rename Robots/{cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs => Start cBot Sample/Start cBot Sample/Start cBot Sample.cs} (100%) rename Robots/{cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj => Start cBot Sample/Start cBot Sample/Start cBot Sample.csproj} (100%) diff --git a/Robots/.samples.json b/Robots/.samples.json index efa7390..4563035 100644 --- a/Robots/.samples.json +++ b/Robots/.samples.json @@ -5,6 +5,9 @@ { "name": "Accumulative Swing Index Sample" }, + { + "name": "Add Indicator Sample" + }, { "name": "AddToChart Sample" }, @@ -38,12 +41,6 @@ { "name": "Bollinger Bands Sample" }, - { - "name": "cBots Adds Indicator Sample" - }, - { - "name": "cBots Starts cBot Sample" - }, { "name": "Center Of Gravity Sample" }, @@ -248,6 +245,9 @@ { "name": "Standard Deviation Sample" }, + { + "name": "Start cBot Sample" + }, { "name": "Stochastic Oscillator Sample" }, diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln b/Robots/Add Indicator Sample/Add Indicator Sample.sln similarity index 82% rename from Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln rename to Robots/Add Indicator Sample/Add Indicator Sample.sln index 400d7b2..f47d4da 100644 --- a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample.sln +++ b/Robots/Add Indicator Sample/Add Indicator Sample.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cBot Starts cBot Sample", "cBot Starts cBot Sample\cBot Starts cBot Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Add Indicator Sample", "Add Indicator Sample\Add Indicator Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs b/Robots/Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.cs similarity index 100% rename from Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.cs rename to Robots/Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.cs diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj b/Robots/Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.csproj similarity index 100% rename from Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample/cBot Adds Indicator Sample.csproj rename to Robots/Add Indicator Sample/Add Indicator Sample/Add Indicator Sample.csproj diff --git a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln b/Robots/Start cBot Sample/Start cBot Sample.sln similarity index 81% rename from Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln rename to Robots/Start cBot Sample/Start cBot Sample.sln index dc26e63..db909a9 100644 --- a/Robots/cBot Adds Indicator Sample/cBot Adds Indicator Sample.sln +++ b/Robots/Start cBot Sample/Start cBot Sample.sln @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio Version 16 VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "cBot Adds Indicator Sample", "cBot Adds Indicator Sample\cBot Adds Indicator Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Start cBot Sample", "Start cBot Sample\Start cBot Sample.csproj", "{1751be77-fe78-4e12-b558-7fb418ed6b44}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs b/Robots/Start cBot Sample/Start cBot Sample/Start cBot Sample.cs similarity index 100% rename from Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.cs rename to Robots/Start cBot Sample/Start cBot Sample/Start cBot Sample.cs diff --git a/Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj b/Robots/Start cBot Sample/Start cBot Sample/Start cBot Sample.csproj similarity index 100% rename from Robots/cBot Starts cBot Sample/cBot Starts cBot Sample/cBot Starts cBot Sample.csproj rename to Robots/Start cBot Sample/Start cBot Sample/Start cBot Sample.csproj From dabad6d4f2298a9b141f3d8a7ae629282811f0ef Mon Sep 17 00:00:00 2001 From: eoseriki Date: Wed, 16 Oct 2024 09:33:12 +0300 Subject: [PATCH 14/15] CNT-794-807: Algo samples (#33) --- Robots/.samples.json | 9 +++ .../Discord Message Example.sln | 22 ++++++ .../Discord Message Example - Backup.csproj | 9 +++ .../Discord Message Example.cs | 56 ++++++++++++++++ .../Discord Message Example.csproj | 29 ++++++++ .../Patterns Strategy Sample.sln | 22 ++++++ .../Patterns Strategy Sample.cs | 59 ++++++++++++++++ .../Patterns Strategy Sample.csproj | 9 +++ .../RSI Reversal Strategy Sample.sln | 22 ++++++ .../RSI Reversal Strategy Sample.cs | 67 +++++++++++++++++++ .../RSI Reversal Strategy Sample.csproj | 9 +++ 11 files changed, 313 insertions(+) create mode 100644 Robots/Discord Message Example/Discord Message Example.sln create mode 100644 Robots/Discord Message Example/Discord Message Example/Discord Message Example - Backup.csproj create mode 100644 Robots/Discord Message Example/Discord Message Example/Discord Message Example.cs create mode 100644 Robots/Discord Message Example/Discord Message Example/Discord Message Example.csproj create mode 100644 Robots/Patterns Strategy Sample/Patterns Strategy Sample.sln create mode 100644 Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.cs create mode 100644 Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.csproj create mode 100644 Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.sln create mode 100644 Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.cs create mode 100644 Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.csproj diff --git a/Robots/.samples.json b/Robots/.samples.json index 4563035..3794733 100644 --- a/Robots/.samples.json +++ b/Robots/.samples.json @@ -83,6 +83,9 @@ { "name": "Directional Movement System Sample" }, + { + "name": "Discord Message Example" + }, { "name": "Donchian Channel Sample" }, @@ -167,6 +170,9 @@ { "name": "Partial Close Sample" }, + { + "name": "Patterns Strategy Sample" + }, { "name": "Pending Order Cancelation Sample" }, @@ -233,6 +239,9 @@ { "name": "Relative Strength Index Sample" }, + { + "name": "RSI Reversal Strategy Sample" + }, { "name": "Running Mode Sample" }, diff --git a/Robots/Discord Message Example/Discord Message Example.sln b/Robots/Discord Message Example/Discord Message Example.sln new file mode 100644 index 0000000..e891495 --- /dev/null +++ b/Robots/Discord Message Example/Discord Message Example.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Discord Message Example", "Discord Message Example\Discord Message Example.csproj", "{4fff20d4-4ec9-4c51-ae35-32c172c2cb2b}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {4fff20d4-4ec9-4c51-ae35-32c172c2cb2b}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {4fff20d4-4ec9-4c51-ae35-32c172c2cb2b}.Debug|Any CPU.Build.0 = Debug|Any CPU + {4fff20d4-4ec9-4c51-ae35-32c172c2cb2b}.Release|Any CPU.ActiveCfg = Release|Any CPU + {4fff20d4-4ec9-4c51-ae35-32c172c2cb2b}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/Discord Message Example/Discord Message Example/Discord Message Example - Backup.csproj b/Robots/Discord Message Example/Discord Message Example/Discord Message Example - Backup.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/Discord Message Example/Discord Message Example/Discord Message Example - Backup.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Robots/Discord Message Example/Discord Message Example/Discord Message Example.cs b/Robots/Discord Message Example/Discord Message Example/Discord Message Example.cs new file mode 100644 index 0000000..d3ecbcc --- /dev/null +++ b/Robots/Discord Message Example/Discord Message Example/Discord Message Example.cs @@ -0,0 +1,56 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example cBot send messages to a Discord channel. +// +// For a detailed tutorial on creating this cBot, watch the video at: https://youtu.be/NhEeySAKZUo +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; +using Discord.WebSocket; +using Discord; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.None, AddIndicators = true)] + public class DiscordMessageExample : Robot + { + [Parameter("Discord Bot Token")] + public string BotToken { get; set; } + + [Parameter("Discord Channel ID")] + public string ChannelID { get; set; } + + DiscordSocketClient _discordSocketClient; + IMessageChannel _channel; + + protected override void OnStart() + { + _discordSocketClient = new DiscordSocketClient(); + _discordSocketClient.LoginAsync(TokenType.Bot, BotToken); + _discordSocketClient.StartAsync(); + + var channelID = Convert.ToUInt64(ChannelID); + _channel = _discordSocketClient.GetChannelAsync(channelID).Result as IMessageChannel; + _channel.SendMessageAsync("Example cBot Started"); + } + + protected override void OnTick() + { + // Handle price updates here + } + + protected override void OnStop() + { + // Handle cBot stop here + } + } +} \ No newline at end of file diff --git a/Robots/Discord Message Example/Discord Message Example/Discord Message Example.csproj b/Robots/Discord Message Example/Discord Message Example/Discord Message Example.csproj new file mode 100644 index 0000000..544c69c --- /dev/null +++ b/Robots/Discord Message Example/Discord Message Example/Discord Message Example.csproj @@ -0,0 +1,29 @@ + + + + net6.0 + + + + + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.Commands.dll + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.Core.dll + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.Interactions.dll + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.Rest.dll + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.Webhook.dll + + + ..\..\..\..\..\..\..\..\Discord DLL Files\Discord.Net.WebSocket.dll + + + \ No newline at end of file diff --git a/Robots/Patterns Strategy Sample/Patterns Strategy Sample.sln b/Robots/Patterns Strategy Sample/Patterns Strategy Sample.sln new file mode 100644 index 0000000..21695c8 --- /dev/null +++ b/Robots/Patterns Strategy Sample/Patterns Strategy Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Patterns Strategy Sample", "Patterns Strategy Sample\Patterns Strategy Sample.csproj", "{b757f66c-537d-4605-b428-bef6881d45a0}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {b757f66c-537d-4605-b428-bef6881d45a0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {b757f66c-537d-4605-b428-bef6881d45a0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {b757f66c-537d-4605-b428-bef6881d45a0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {b757f66c-537d-4605-b428-bef6881d45a0}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.cs b/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.cs new file mode 100644 index 0000000..170c2ac --- /dev/null +++ b/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.cs @@ -0,0 +1,59 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example cBot trades the hammer pattern for long entries and the hanging man pattern for short entries. +// +// For a detailed tutorial on creating this cBot, watch the video at: https://youtu.be/mEoIvP11Z1U +// +// ------------------------------------------------------------------------------------------------- + +using System; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.None, AddIndicators = true)] + public class PatternsStrategySample : Robot + { + [Parameter(DefaultValue = 1000)] + public double Volume { get; set; } + + [Parameter(DefaultValue = 10)] + public double StopLoss { get; set; } + + [Parameter(DefaultValue = 10)] + public double TakeProfit { get; set; } + + protected override void OnStart() + { + + } + + protected override void OnBarClosed() + { + if (Bars.Last(0).Close == Bars.Last(0).High && + (Bars.Last(0).Close - Bars.Last(0).Open) < (Bars.Last(0).Close - Bars.Last(0).Low) * 0.2) + { + ExecuteMarketOrder(TradeType.Buy, SymbolName, Volume, InstanceId, StopLoss, TakeProfit); + } + + if (Bars.Last(0).Close == Bars.Last(0).Low && + (Bars.Last(0).Open - Bars.Last(0).Close) < (Bars.Last(0).High - Bars.Last(0).Close) * 0.2) + { + ExecuteMarketOrder(TradeType.Sell, SymbolName, Volume, InstanceId, StopLoss, TakeProfit); + } + + } + + protected override void OnStop() + { + + } + } +} \ No newline at end of file diff --git a/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.csproj b/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/Patterns Strategy Sample/Patterns Strategy Sample/Patterns Strategy Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + diff --git a/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.sln b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.sln new file mode 100644 index 0000000..9499c64 --- /dev/null +++ b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "RSI Reversal Strategy Sample", "RSI Reversal Strategy Sample\RSI Reversal Strategy Sample.csproj", "{e72d7681-531b-4abe-8c9a-e2a74e52eb7a}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {e72d7681-531b-4abe-8c9a-e2a74e52eb7a}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {e72d7681-531b-4abe-8c9a-e2a74e52eb7a}.Debug|Any CPU.Build.0 = Debug|Any CPU + {e72d7681-531b-4abe-8c9a-e2a74e52eb7a}.Release|Any CPU.ActiveCfg = Release|Any CPU + {e72d7681-531b-4abe-8c9a-e2a74e52eb7a}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.cs b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.cs new file mode 100644 index 0000000..cfbd0d5 --- /dev/null +++ b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.cs @@ -0,0 +1,67 @@ +// ------------------------------------------------------------------------------------------------- +// +// This code is a cTrader Algo API example. +// +// The code is provided as a sample only and does not guarantee any particular outcome or profit of any kind. Use it at your own risk. +// +// This example cBot implements a strategy based on the Relative Strength Index (RSI) indicator reversal. +// +// For a detailed tutorial on creating this cBot, watch the video at: https://youtu.be/mEoIvP11Z1U +// +// ------------------------------------------------------------------------------------------------- + +using System; +using System.Linq; +using cAlgo.API; +using cAlgo.API.Collections; +using cAlgo.API.Indicators; +using cAlgo.API.Internals; + +namespace cAlgo.Robots +{ + [Robot(AccessRights = AccessRights.None, AddIndicators = true)] + public class RSIReversalStrategySample : Robot + { + [Parameter(DefaultValue = 30)] + public int BuyLevel { get; set; } + + [Parameter(DefaultValue = 70)] + public int SellLevel { get; set; } + + private RelativeStrengthIndex _rsi; + + protected override void OnStart() + { + _rsi = Indicators.RelativeStrengthIndex(Bars.ClosePrices, 14); + } + + protected override void OnBarClosed() + { + if (_rsi.Result.LastValue < BuyLevel) + { + if (Positions.Count == 0) + ExecuteMarketOrder(TradeType.Buy, SymbolName, 1000); + foreach (var position in Positions.Where(p => p.TradeType == TradeType.Sell)) + { + position.Close(); + } + + } + + else if (_rsi.Result.LastValue > SellLevel) + { + if (Positions.Count == 0) + ExecuteMarketOrder(TradeType.Sell, SymbolName, 1000); + foreach (var position in Positions.Where(p => p.TradeType == TradeType.Buy)) + { + position.Close(); + } + } + } + + protected override void OnStop() + { + + } + } +} \ No newline at end of file diff --git a/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.csproj b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.csproj new file mode 100644 index 0000000..51ac844 --- /dev/null +++ b/Robots/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample/RSI Reversal Strategy Sample.csproj @@ -0,0 +1,9 @@ + + + net6.0 + + + + + + From dbf0647e7c1861cdf1b06e77537b1e8875d6f2f2 Mon Sep 17 00:00:00 2001 From: Ahmad Noman Musleh Date: Mon, 17 Feb 2025 13:46:40 +0300 Subject: [PATCH 15/15] XT-17009 Algorithms templates contains references to obsolete properties in 5.2. Remove obsolete API uses from Order by Margin plugin. --- Plugins/Order by Margin/Order by Margin/Order by Margin.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/Plugins/Order by Margin/Order by Margin/Order by Margin.cs b/Plugins/Order by Margin/Order by Margin/Order by Margin.cs index 769aa18..42e96a2 100644 --- a/Plugins/Order by Margin/Order by Margin/Order by Margin.cs +++ b/Plugins/Order by Margin/Order by Margin/Order by Margin.cs @@ -52,9 +52,8 @@ private void AspSymbolTab_SymbolChanged(AspSymbolChangedEventArgs obj) private void AddControls() { var block = Asp.SymbolTab.AddBlock("New Order by Margin"); - block.IsExpanded = true; + block.IsDetachable = false; - block.Index = 1; block.Height = 150; var rootStackPanel = new StackPanel { Margin = new Thickness(10) };