Optimizing and Refactoring HmaClusterBot & -Indicator
This commit is contained in:
Binary file not shown.
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Candlestick Patterns DEMO", "Candlestick Patterns DEMO\Candlestick Patterns DEMO.csproj", "{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-504
@@ -1,504 +0,0 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using cAlgo.API;
|
||||
using cAlgo.API.Internals;
|
||||
using cAlgo.API.Indicators;
|
||||
using cAlgo.Indicators;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.FileSystem)]
|
||||
public class CP : Indicator
|
||||
{
|
||||
#region Parameters
|
||||
|
||||
[Parameter("Show names", DefaultValue = false)]
|
||||
public bool Name_Status { get; set; }
|
||||
|
||||
[Parameter("Show more info", DefaultValue = true)]
|
||||
public bool Add_info { get; set; }
|
||||
|
||||
[Parameter("Show Doji", DefaultValue = true)]
|
||||
public bool Show_Doji { get; set; }
|
||||
|
||||
[Parameter("Show Hammer", DefaultValue = true)]
|
||||
public bool Show_Hammer { get; set; }
|
||||
|
||||
[Parameter("MACD Long Cycle", DefaultValue = 26)]
|
||||
public int LongCycle { get; set; }
|
||||
|
||||
[Parameter("MACD Short Cycle", DefaultValue = 12)]
|
||||
public int ShortCycle { get; set; }
|
||||
|
||||
[Parameter("MACD Signal Periods", DefaultValue = 9)]
|
||||
public int Periods { get; set; }
|
||||
|
||||
[Parameter("Doji", DefaultValue = "✝")]
|
||||
public string Doji_s { get; set; }
|
||||
[Parameter("Hammer", DefaultValue = "☨")]
|
||||
public string Hammer_s { get; set; }
|
||||
|
||||
#endregion Parameters
|
||||
|
||||
private MacdHistogram macd;
|
||||
|
||||
private const VerticalAlignment vAlign = VerticalAlignment.Top;
|
||||
private const HorizontalAlignment hAlign = HorizontalAlignment.Center;
|
||||
|
||||
private const double n = 0.618;
|
||||
|
||||
private const string UpArrow = "▲";
|
||||
private const string DownArrow = "▼";
|
||||
|
||||
private string Pattern_name;
|
||||
|
||||
private double offset;
|
||||
|
||||
private struct Candle
|
||||
{
|
||||
#region Data
|
||||
|
||||
public double High;
|
||||
public double Close;
|
||||
public double Open;
|
||||
public double Low;
|
||||
|
||||
#endregion Data
|
||||
|
||||
#region Functions
|
||||
|
||||
public bool IsFallCandle()
|
||||
{
|
||||
if (Close < Open)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
public bool IsRiseCandle()
|
||||
{
|
||||
if (Open < Close)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public double Median()
|
||||
{
|
||||
return (High + Low) / 2;
|
||||
}
|
||||
|
||||
#endregion Functions
|
||||
}
|
||||
|
||||
private enum PatternType : int
|
||||
{
|
||||
Doji = 1,
|
||||
Hammer = 2
|
||||
}
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
macd = Indicators.MacdHistogram(MarketSeries.Close, LongCycle, ShortCycle, Periods);
|
||||
offset = Symbol.PipSize * 5;
|
||||
}
|
||||
|
||||
private void DrawText(int index, int _Type)
|
||||
{
|
||||
var high = MarketSeries.High[index];
|
||||
var low = MarketSeries.Low[index];
|
||||
|
||||
int x = index;
|
||||
|
||||
double h_y = high + offset;
|
||||
double h_d_y = h_y + offset * 2.5;
|
||||
double h_t_y = h_d_y + offset;
|
||||
|
||||
double l_y = low - offset * 2.5;
|
||||
double l_d_y = l_y - offset;
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Minute)
|
||||
{
|
||||
h_y = high + offset / 2;
|
||||
h_d_y = h_y + offset / 2;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset / 2;
|
||||
l_d_y = l_y - offset / 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Minute15)
|
||||
{
|
||||
h_y = high + offset / 1.5;
|
||||
h_d_y = h_y + offset;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 1.5;
|
||||
l_d_y = l_y - offset * 1.1;
|
||||
}
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Hour)
|
||||
{
|
||||
h_y = high + offset;
|
||||
h_d_y = h_y + offset * 3;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 3;
|
||||
l_d_y = l_y - offset * 3;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Hour4)
|
||||
{
|
||||
h_y = high + offset;
|
||||
h_d_y = h_y + offset * 5;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 5;
|
||||
l_d_y = l_y - offset * 5;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Daily)
|
||||
{
|
||||
h_y = high + offset * 3;
|
||||
h_d_y = h_y + offset * 12;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 12;
|
||||
l_d_y = l_y - offset * 12;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Weekly)
|
||||
{
|
||||
h_y = high + offset * 6;
|
||||
h_d_y = h_y + offset * 24;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 24;
|
||||
l_d_y = l_y - offset * 24;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Monthly)
|
||||
{
|
||||
h_y = high + offset * 24;
|
||||
h_d_y = h_y + offset * 64;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 64;
|
||||
l_d_y = l_y - offset * 64;
|
||||
}
|
||||
|
||||
string f_ObjName;
|
||||
string s_ObjName;
|
||||
|
||||
switch (_Type)
|
||||
{
|
||||
case (int)PatternType.Doji:
|
||||
|
||||
f_ObjName = string.Format("Doji {0}", index);
|
||||
s_ObjName = string.Format("Doji | {0}", index);
|
||||
|
||||
ChartObjects.DrawText(f_ObjName, "Doji", x, h_d_y, vAlign, hAlign, Colors.White);
|
||||
ChartObjects.DrawText(s_ObjName, "\n|", x, h_y, vAlign, hAlign, Colors.White);
|
||||
|
||||
break;
|
||||
|
||||
case (int)PatternType.Hammer:
|
||||
|
||||
f_ObjName = string.Format("Hammer {0}", index);
|
||||
s_ObjName = string.Format("Hammer | {0}", index);
|
||||
|
||||
ChartObjects.DrawText(f_ObjName, "Hammer", x, h_d_y, vAlign, hAlign, Colors.White);
|
||||
ChartObjects.DrawText(s_ObjName, "\n|", x, h_y, vAlign, hAlign, Colors.White);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawSymbols(int index, int _Type)
|
||||
{
|
||||
var high = MarketSeries.High[index];
|
||||
var low = MarketSeries.Low[index];
|
||||
|
||||
int x = index;
|
||||
|
||||
double h_y = high + offset;
|
||||
double h_d_y = h_y + offset * 2.5;
|
||||
double h_t_y = h_d_y + offset;
|
||||
|
||||
double l_y = low - offset * 2.5;
|
||||
double l_d_y = l_y - offset;
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Minute)
|
||||
{
|
||||
h_y = high + offset / 2;
|
||||
h_d_y = h_y + offset / 2;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset / 2;
|
||||
l_d_y = l_y - offset / 2;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Minute15)
|
||||
{
|
||||
h_y = high + offset / 1.5;
|
||||
h_d_y = h_y + offset;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 1.5;
|
||||
l_d_y = l_y - offset * 1.1;
|
||||
}
|
||||
|
||||
|
||||
if (TimeFrame == TimeFrame.Hour)
|
||||
{
|
||||
h_y = high + offset;
|
||||
h_d_y = h_y + offset * 3;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 3;
|
||||
l_d_y = l_y - offset * 3;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Hour4)
|
||||
{
|
||||
h_y = high + offset;
|
||||
h_d_y = h_y + offset * 5;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 5;
|
||||
l_d_y = l_y - offset * 5;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Daily)
|
||||
{
|
||||
h_y = high + offset * 3;
|
||||
h_d_y = h_y + offset * 12;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 12;
|
||||
l_d_y = l_y - offset * 12;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Weekly)
|
||||
{
|
||||
h_y = high + offset * 6;
|
||||
h_d_y = h_y + offset * 24;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 24;
|
||||
l_d_y = l_y - offset * 24;
|
||||
}
|
||||
|
||||
if (TimeFrame == TimeFrame.Monthly)
|
||||
{
|
||||
h_y = high + offset * 24;
|
||||
h_d_y = h_y + offset * 64;
|
||||
h_t_y = h_d_y + offset;
|
||||
|
||||
l_y = low - offset * 64;
|
||||
l_d_y = l_y - offset * 64;
|
||||
}
|
||||
|
||||
string f_ObjName;
|
||||
string s_ObjName;
|
||||
|
||||
switch (_Type)
|
||||
{
|
||||
case (int)PatternType.Doji:
|
||||
|
||||
f_ObjName = string.Format("Doji {0}", index);
|
||||
s_ObjName = string.Format("Doji | {0}", index);
|
||||
|
||||
ChartObjects.DrawText(f_ObjName, Doji_s, x, h_d_y, vAlign, hAlign, Colors.White);
|
||||
ChartObjects.DrawText(s_ObjName, "\n|", x, h_y, vAlign, hAlign, Colors.White);
|
||||
|
||||
break;
|
||||
|
||||
case (int)PatternType.Hammer:
|
||||
|
||||
f_ObjName = string.Format("Hammer {0}", index);
|
||||
s_ObjName = string.Format("Hammer | {0}", index);
|
||||
|
||||
ChartObjects.DrawText(f_ObjName, Hammer_s, x, h_d_y, vAlign, hAlign, Colors.DarkOrange);
|
||||
ChartObjects.DrawText(s_ObjName, "\n|", x, h_y, vAlign, hAlign, Colors.White);
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private bool Size(Candle candle)
|
||||
{
|
||||
if (candle.IsFallCandle())
|
||||
{
|
||||
if ((candle.Open - candle.Close) > (candle.High - candle.Low) * n)
|
||||
return true;
|
||||
}
|
||||
else if (candle.IsRiseCandle())
|
||||
{
|
||||
if ((candle.Close - candle.Open) > (candle.High - candle.Low) * n)
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private void Text_Info(int index, string Pattern_name)
|
||||
{
|
||||
if (Add_info == true)
|
||||
{
|
||||
|
||||
#region Pattern
|
||||
|
||||
ChartObjects.DrawText("PATTERN", "LAST PATTERN : " + Pattern_name, StaticPosition.TopLeft, Colors.White);
|
||||
|
||||
#endregion Pattern
|
||||
|
||||
#region MACD
|
||||
|
||||
if (MACD_Info(index) == "UP")
|
||||
{
|
||||
ChartObjects.DrawText("MACD", "\nMACD : ", StaticPosition.TopLeft, Colors.White);
|
||||
ChartObjects.DrawText("ARROW MACD", "\n\t" + UpArrow, StaticPosition.TopLeft, Colors.DodgerBlue);
|
||||
|
||||
}
|
||||
else if (MACD_Info(index) == "DOWN")
|
||||
{
|
||||
ChartObjects.DrawText("MACD", "\nMACD : ", StaticPosition.TopLeft, Colors.White);
|
||||
ChartObjects.DrawText("ARROW MACD", "\n\t" + DownArrow, StaticPosition.TopLeft, Colors.Crimson);
|
||||
}
|
||||
|
||||
#endregion MACD
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
private string MACD_Info(int index)
|
||||
{
|
||||
if (macd.Histogram[index] > 0)
|
||||
{
|
||||
return "UP";
|
||||
}
|
||||
|
||||
if (macd.Histogram[index] < 0)
|
||||
{
|
||||
return "DOWN";
|
||||
}
|
||||
return "ZERO";
|
||||
}
|
||||
|
||||
|
||||
private bool Doji(Candle candle)
|
||||
{
|
||||
|
||||
if (candle.IsFallCandle() & (candle.Close != candle.Low))
|
||||
{
|
||||
if ((candle.High - candle.Low) > 12 * (candle.Open - candle.Close))
|
||||
return true;
|
||||
}
|
||||
if (candle.IsRiseCandle() & (candle.Close != candle.High))
|
||||
{
|
||||
if ((candle.High - candle.Low) > 12 * (candle.Close - candle.Open))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
private bool Hammer(Candle candle)
|
||||
{
|
||||
if (candle.IsFallCandle() & (candle.Close == candle.Low))
|
||||
{
|
||||
if ((candle.Median() > candle.Open) & (candle.Median() > candle.Close))
|
||||
{
|
||||
if ((candle.Median() - candle.Low) > 1.618 * (candle.Open - candle.Close))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
if (candle.IsRiseCandle() & (candle.Close == candle.High))
|
||||
{
|
||||
if ((candle.Median() < candle.Open) & (candle.Median() < candle.Close))
|
||||
{
|
||||
if ((candle.High - candle.Median()) > 1.618 * (candle.Close - candle.Open))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public override void Calculate(int index)
|
||||
{
|
||||
#region structs
|
||||
|
||||
Candle candle = new Candle();
|
||||
|
||||
#endregion structs
|
||||
|
||||
#region variables
|
||||
|
||||
int candle_index = 0;
|
||||
|
||||
candle.High = MarketSeries.High.Last(candle_index);
|
||||
candle.Open = MarketSeries.Open.Last(candle_index);
|
||||
candle.Close = MarketSeries.Close.Last(candle_index);
|
||||
candle.Low = MarketSeries.Low.Last(candle_index);
|
||||
|
||||
#endregion variables
|
||||
|
||||
#region Patterns
|
||||
|
||||
// Doji
|
||||
|
||||
if (Doji(candle))
|
||||
{
|
||||
if (Show_Doji == true)
|
||||
{
|
||||
Pattern_name = "Doji";
|
||||
if (Name_Status == true)
|
||||
{
|
||||
DrawText(index, (int)PatternType.Doji);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSymbols(index, (int)PatternType.Doji);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Hammer
|
||||
|
||||
if (Hammer(candle))
|
||||
{
|
||||
if (Show_Hammer == true)
|
||||
{
|
||||
Pattern_name = "Hammer";
|
||||
if (Name_Status == true)
|
||||
{
|
||||
DrawText(index, (int)PatternType.Hammer);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawSymbols(index, (int)PatternType.Hammer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endregion Patterns
|
||||
|
||||
#region Text
|
||||
|
||||
Text_Info(index, Pattern_name);
|
||||
|
||||
#endregion Text
|
||||
}
|
||||
}
|
||||
}
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{B9F710D0-7DD5-4E04-B2E9-98C1878E7674}</ProjectGuid>
|
||||
<ProjectTypeGuids>{DD87C1B2-3799-4CA2-93B6-5288EE928820};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>cAlgo</RootNamespace>
|
||||
<AssemblyName>Candlestick Patterns DEMO</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="cAlgo.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3499da3018340880, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\API\cAlgo.API.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Candlestick Patterns DEMO.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
-16
@@ -1,16 +0,0 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Candlestick Patterns DEMO")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Candlestick Patterns DEMO")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("35f19c43-c7cc-4f53-b8e0-61caaf9cd8e8")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
Binary file not shown.
@@ -1,22 +0,0 @@
|
||||
|
||||
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}") = "Correlation with angle v1.1", "Correlation with angle v1.1\Correlation with angle v1.1.csproj", "{0e2c43ed-8f8d-446b-848e-ed1fe9ef49a2}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{0e2c43ed-8f8d-446b-848e-ed1fe9ef49a2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{0e2c43ed-8f8d-446b-848e-ed1fe9ef49a2}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{0e2c43ed-8f8d-446b-848e-ed1fe9ef49a2}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{0e2c43ed-8f8d-446b-848e-ed1fe9ef49a2}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-249
@@ -1,249 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using cAlgo.API;
|
||||
using cAlgo.API.Indicators;
|
||||
using cAlgo.API.Internals;
|
||||
using cAlgo.Indicators;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
|
||||
public class Correlationwithanglev11 : Indicator
|
||||
{
|
||||
[Parameter("Symbol Selection Method", DefaultValue = SymbolSelectionMethodType.SymbolList, Group = "Symbole Choice \n(Uncomment code for more than 6 Symbole)")]
|
||||
public SymbolSelectionMethodType SymbolSelectionMethod { get; set; }
|
||||
public enum SymbolSelectionMethodType
|
||||
{
|
||||
WatchList,
|
||||
SymbolList
|
||||
}
|
||||
|
||||
[Parameter("Symbol List 1 / WatchList Name 1:", DefaultValue = "XAUUSD", Group = "Symbol Management (5 Symbol / List Maximum)")]
|
||||
public string TradedSymbols1 { get; set; }
|
||||
[Parameter("Symbol List 2 / WatchList Name 2:", DefaultValue = "SpotBrent", Group = "Symbol Management (5 Symbol / List Maximum)")]
|
||||
public string TradedSymbols2 { get; set; }
|
||||
|
||||
[Parameter("ExtraLevel", DefaultValue = 50, Group = "Angle Level")]
|
||||
public int ExtraLevel { get; set; }
|
||||
|
||||
[Parameter("PeriodA ngle", DefaultValue = 14, Group = "Angle Setting")]
|
||||
public int PeriodAngle { get; set; }
|
||||
[Parameter("Loockback Periods Angle", DefaultValue = 1, Group = "Angle Setting")]
|
||||
public int LookbackAngle { get; set; }
|
||||
[Parameter("Price Smooth Type", DefaultValue = MovingAverageType.Weighted, Group = "Angle Setting")]
|
||||
public MovingAverageType MaTypeAngle { get; set; }
|
||||
|
||||
[Parameter("History Diff Angle", DefaultValue = 1, Group = "Base Setting")]
|
||||
public int HistoryTextLookback { get; set; }
|
||||
|
||||
[Parameter("ShowSignals", DefaultValue = true, Group = "Histogram Setting")]
|
||||
public bool ShowSignal { get; set; }
|
||||
[Parameter("Sensibility Histogram", DefaultValue = 0.3, Group = "Histogram Setting")]
|
||||
public double SensibilityHisto { get; set; }
|
||||
|
||||
[Parameter("Signal Periods", DefaultValue = 55, Group = "Histogram Setting")]
|
||||
public int SignalPeriods { get; set; }
|
||||
[Parameter("Price Smooth Type", DefaultValue = MovingAverageType.Weighted, Group = "Histogram Setting")]
|
||||
public MovingAverageType MaTypeSignal { get; set; }
|
||||
|
||||
[Output("List 1 : Symb n° 1", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN1 { get; set; }
|
||||
[Output("List 1 : Symb n° 2", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN2 { get; set; }
|
||||
[Output("List 1 : Symb n° 3", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN3 { get; set; }
|
||||
[Output("List 1 : Symb n° 4", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN4 { get; set; }
|
||||
[Output("List 1 : Symb n° 5", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN5 { get; set; }
|
||||
|
||||
[Output("List 2 : Symb n° 6", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN6 { get; set; }
|
||||
[Output("List 2 : Symb n° 7", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN7 { get; set; }
|
||||
[Output("List 2 : Symb n° 8", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN8 { get; set; }
|
||||
[Output("List 2 : Symb n° 9", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN9 { get; set; }
|
||||
[Output("List 2 : Symb n° 10", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN10 { get; set; }
|
||||
|
||||
[Output("LevelHigh", LineColor = "Gold", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries LevelHigh { get; set; }
|
||||
[Output("LevelMid", LineColor = "White", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries LevelMid { get; set; }
|
||||
[Output("LevelLow", LineColor = "Gold", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries LevelLow { get; set; }
|
||||
|
||||
private MovingAverage[] angleIndex1, angleIndex2;
|
||||
private AverageTrueRange[] atrIndex1, atrIndex2;
|
||||
|
||||
private Symbol[] TradeList1, TradeList2;
|
||||
private Bars[] bars1, bars2;
|
||||
private IndicatorDataSeries[] ResPaireWatchlist1, ResPaireWatchlist2;
|
||||
private int[] indexBars1, indexBars2;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
if (SymbolSelectionMethod == SymbolSelectionMethodType.WatchList)
|
||||
{
|
||||
// Get the trade list from the watchlist 1 provided by the user
|
||||
foreach (Watchlist w in Watchlists)
|
||||
{
|
||||
if (w.Name == TradedSymbols1)
|
||||
{
|
||||
TradeList1 = Symbols.GetSymbols(w.SymbolNames.ToArray());
|
||||
}
|
||||
}
|
||||
// Get the trade list from the watchlist 2 provided by the user
|
||||
foreach (Watchlist w in Watchlists)
|
||||
{
|
||||
if (w.Name == TradedSymbols2)
|
||||
{
|
||||
TradeList2 = Symbols.GetSymbols(w.SymbolNames.ToArray());
|
||||
}
|
||||
}
|
||||
Print();
|
||||
Print("Watchlist 1 : [ {0} ] = {1} symbols || Watchlist 2 : [ {2} ] = {3} symbols", Bars.ToString().Substring(0, 3), TradeList1.Length, Bars.ToString().Substring(3, 3), TradeList2.Length);
|
||||
Print();
|
||||
}
|
||||
else if (SymbolSelectionMethod == SymbolSelectionMethodType.SymbolList)
|
||||
{
|
||||
// Get the trade list from the SymbolList provided by the user
|
||||
string[] SymbolList = TradedSymbols1.Split(' ');
|
||||
TradeList1 = Symbols.GetSymbols(SymbolList);
|
||||
|
||||
// Get the trade list from the SymbolList provided by the user
|
||||
string[] SymbolList2 = TradedSymbols2.Split(' ');
|
||||
TradeList2 = Symbols.GetSymbols(SymbolList2);
|
||||
}
|
||||
|
||||
//Create Indicators for Watchlist 1
|
||||
angleIndex1 = new MovingAverage[TradeList1.Length];
|
||||
atrIndex1 = new AverageTrueRange[TradeList1.Length];
|
||||
bars1 = new Bars[TradeList1.Length];
|
||||
indexBars1 = new int[TradeList1.Length];
|
||||
ResPaireWatchlist1 = new IndicatorDataSeries[TradeList1.Length];
|
||||
|
||||
//Create Indicators for Watchlist 2
|
||||
angleIndex2 = new MovingAverage[TradeList2.Length];
|
||||
atrIndex2 = new AverageTrueRange[TradeList2.Length];
|
||||
bars2 = new Bars[TradeList2.Length];
|
||||
indexBars2 = new int[TradeList2.Length];
|
||||
ResPaireWatchlist2 = new IndicatorDataSeries[TradeList2.Length];
|
||||
|
||||
//Initialize Indicators for Watchlist 1
|
||||
int i = 0;
|
||||
foreach (var symbol in TradeList1)
|
||||
{
|
||||
Print("Watchlist : [ {0} ] => {1} symbols = {2}", Bars.SymbolName, (i + 1), symbol.Name);
|
||||
//Load bars of watchlist 1
|
||||
bars1[i] = MarketData.GetBars(TimeFrame, symbol.Name);
|
||||
while (bars1[i].OpenTimes[0] > Bars.OpenTimes[0])
|
||||
bars1[i].LoadMoreHistory();
|
||||
|
||||
//Load Futurs DataSerie watchlist 1 (calculation in Calculate(int index))
|
||||
ResPaireWatchlist1[i] = CreateDataSeries();
|
||||
|
||||
//Load Indicators watchlist 1
|
||||
|
||||
atrIndex1[i] = Indicators.AverageTrueRange(bars1[i], 500, MovingAverageType.Simple);
|
||||
angleIndex1[i] = Indicators.MovingAverage(bars1[i].ClosePrices, PeriodAngle, MaTypeAngle);
|
||||
i++;
|
||||
}
|
||||
//Initialize Indicators for Watchlist 2
|
||||
Print();
|
||||
|
||||
int j = 0;
|
||||
foreach (var symbol2 in TradeList2)
|
||||
{
|
||||
Print("Watchlist : [ {0} ] => {1} symbols = {2}", Bars.SymbolName, (j + 1), symbol2.Name);
|
||||
//Load bars of watchlist 2
|
||||
bars2[j] = MarketData.GetBars(TimeFrame, symbol2.Name);
|
||||
while (bars2[j].OpenTimes[0] > Bars.OpenTimes[0])
|
||||
bars2[j].LoadMoreHistory();
|
||||
|
||||
//Load Futurs DataSerie watchlist 2 (calculation in Calculate(int index))
|
||||
ResPaireWatchlist2[j] = CreateDataSeries();
|
||||
|
||||
//Load Indicators watchlist 2
|
||||
atrIndex2[j] = Indicators.AverageTrueRange(bars2[j], 500, MovingAverageType.Simple);
|
||||
angleIndex2[j] = Indicators.MovingAverage(bars2[j].ClosePrices, PeriodAngle, MaTypeAngle);
|
||||
j++;
|
||||
}
|
||||
Print();
|
||||
}
|
||||
public override void Calculate(int index)
|
||||
{
|
||||
//Plot Static level on indicator
|
||||
LevelHigh[index] = ExtraLevel;
|
||||
LevelMid[index] = 0;
|
||||
LevelLow[index] = 0 - ExtraLevel;
|
||||
|
||||
if (index < PeriodAngle)
|
||||
return;
|
||||
|
||||
//Calculate angle by symbol list 1
|
||||
for (int i = 0; i < TradeList1.Length; i++)
|
||||
{
|
||||
indexBars1[i] = bars1[i].OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
|
||||
ResPaireWatchlist1[i][index] = GetCalculationAngle(angleIndex1[i].Result[indexBars1[i]], angleIndex1[i].Result[indexBars1[i] - LookbackAngle], atrIndex1[i].Result[indexBars1[i]]);
|
||||
}
|
||||
|
||||
//Remove Static text of difference into index and index - HistoryTextLookback
|
||||
if (IndicatorArea.FindAllObjects(ChartObjectType.Text).Length > 0)
|
||||
IndicatorArea.RemoveAllObjects();
|
||||
//Calculate difference into index and index - HistoryTextLookback list 1
|
||||
for (int i = 0; i < TradeList1.Length; i++)
|
||||
IndicatorArea.DrawText((TradeList1[i]).ToString() + index, TradeList1[i] + " : " + ResPaireWatchlist1[i][index].ToString("F2"), index + 2, double.IsNaN(ResPaireWatchlist1[i][index]) ? 0 : ResPaireWatchlist1[i][index], ResPaireWatchlist1[i][index] > ResPaireWatchlist1[i][index - HistoryTextLookback] ? Color.Lime : Color.Red);
|
||||
|
||||
//Output the result like symbolList number != output number list 1
|
||||
int j = TradeList1.Length - 1;
|
||||
SymbN1[index] = ResPaireWatchlist1[0 < j ? 0 : j][index];
|
||||
SymbN2[index] = ResPaireWatchlist1[1 < j ? 1 : j][index];
|
||||
SymbN3[index] = ResPaireWatchlist1[2 < j ? 2 : j][index];
|
||||
SymbN4[index] = ResPaireWatchlist1[3 < j ? 3 : j][index];
|
||||
SymbN5[index] = ResPaireWatchlist1[4 < j ? 4 : j][index];
|
||||
|
||||
//Calculate angle by symbol list 2
|
||||
for (int i = 0; i < TradeList2.Length; i++)
|
||||
{
|
||||
indexBars2[i] = bars2[i].OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
|
||||
ResPaireWatchlist2[i][index] = GetCalculationAngle(angleIndex2[i].Result[indexBars2[i]], angleIndex2[i].Result[indexBars2[i] - LookbackAngle], atrIndex2[i].Result[indexBars2[i]]);
|
||||
}
|
||||
|
||||
//Calculate difference into index and index - HistoryTextLookback list 2
|
||||
for (int i = 0; i < TradeList2.Length; i++)
|
||||
IndicatorArea.DrawText((TradeList2[i]).ToString() + index, TradeList2[i] + " : " + ResPaireWatchlist2[i][index].ToString("F2"), index + 2, double.IsNaN(ResPaireWatchlist2[i][index]) ? 0 : ResPaireWatchlist2[i][index], ResPaireWatchlist2[i][index] > ResPaireWatchlist2[i][index - HistoryTextLookback] ? Color.Lime : Color.Red);
|
||||
|
||||
//Output the result like symbolList number != output number list 2
|
||||
int k = TradeList2.Length - 1;
|
||||
SymbN6[index] = ResPaireWatchlist2[0 < k ? 0 : k][index];
|
||||
SymbN7[index] = ResPaireWatchlist2[1 < k ? 1 : k][index];
|
||||
SymbN8[index] = ResPaireWatchlist2[2 < k ? 2 : k][index];
|
||||
SymbN9[index] = ResPaireWatchlist2[3 < k ? 3 : k][index];
|
||||
SymbN10[index] = ResPaireWatchlist2[4 < k ? 4 : k][index];
|
||||
|
||||
}
|
||||
|
||||
//Function for angle calculation with atr normalization
|
||||
public double GetCalculationAngle(double priceSmooth, double priceSmoothLoockBack, double atr)
|
||||
{
|
||||
var _momentumpositive = priceSmooth - priceSmoothLoockBack;
|
||||
var _momentumnegative = priceSmoothLoockBack - priceSmooth;
|
||||
var _momentum = priceSmooth > priceSmoothLoockBack
|
||||
? _momentumpositive / atr
|
||||
: _momentumnegative / atr;
|
||||
var _hypothenuse = Math.Sqrt((_momentum * _momentum) + (LookbackAngle * LookbackAngle));
|
||||
var _cos = (LookbackAngle / _hypothenuse);
|
||||
var _angle = priceSmooth > priceSmoothLoockBack
|
||||
? (0 + (Math.Acos(_cos) * 100))
|
||||
: (0 - (Math.Acos(_cos) * 100));
|
||||
return _angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
-9
@@ -1,9 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="cTrader.Automate" Version="1.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
@@ -1,182 +0,0 @@
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using cAlgo.API;
|
||||
using cAlgo.API.Indicators;
|
||||
using cAlgo.API.Internals;
|
||||
using cAlgo.Indicators;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
//[Cloud("Fast Smooth", "Slow Smooth", FirstColor = "Green", SecondColor = "Red", Opacity = 0.1)]
|
||||
[Levels(0)]
|
||||
[Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
|
||||
public class AngleOfMultiSymbol : Indicator
|
||||
{
|
||||
[Parameter("Symbol Selection Method", DefaultValue = SymbolSelectionMethodType.SymbolList, Group = "Symbole Choice \n(Uncomment code for more than 6 Symbole)")]
|
||||
public SymbolSelectionMethodType SymbolSelectionMethod { get; set; }
|
||||
[Parameter("Symbol List", DefaultValue = "EURUSD GBPUSD AUDUSD USDCHF", Group = "Symbole Choice \n(Uncomment code for more than 6 Symbole)")]
|
||||
public string TradedSymbols { get; set; }
|
||||
[Parameter("Watchlist Name", DefaultValue = "My Watchlist", Group = "Symbole Choice \n(Uncomment code for more than 6 Symbole)")]
|
||||
public string WatchlistName { get; set; }
|
||||
|
||||
public enum SymbolSelectionMethodType
|
||||
{
|
||||
CurrentChart,
|
||||
SymbolList,
|
||||
WatchList
|
||||
}
|
||||
|
||||
[Parameter("History Diff Angle", DefaultValue = 1, Group = "Base Setting")]
|
||||
public int HistoryTextLookback { get; set; }
|
||||
[Parameter("Tf", DefaultValue = "Hour1", Group = "Base Setting")]
|
||||
public TimeFrame Tf { get; set; }
|
||||
[Parameter("Price Smooth Period (255)", DefaultValue = 255, Group = "Angle Setting")]
|
||||
public int SmoothPeriods { get; set; }
|
||||
[Parameter("Price Smooth Type", DefaultValue = MovingAverageType.Weighted, Group = "Angle Setting")]
|
||||
public MovingAverageType MaType { get; set; }
|
||||
[Parameter("Loockback Periods Angle", DefaultValue = 1, Group = "Angle Setting")]
|
||||
public int LookbackPeriodsAngle { get; set; }
|
||||
[Parameter("Sensitivity (1.0)", DefaultValue = 1, Group = "Angle Setting")]
|
||||
public double Sensitivity { get; set; }
|
||||
|
||||
[Output("Symb n° 1", LineColor = "White", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN1 { get; set; }
|
||||
[Output("Symb n° 2", LineColor = "Lime", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN2 { get; set; }
|
||||
[Output("Symb n° 3", LineColor = "Green", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN3 { get; set; }
|
||||
[Output("Symb n° 4", LineColor = "DeepSkyBlue", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN4 { get; set; }
|
||||
[Output("Symb n° 5", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN5 { get; set; }
|
||||
[Output("Symb n° 6", LineColor = "Magenta", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN6 { get; set; }
|
||||
|
||||
/*Uncomment For more Symbole on the chart
|
||||
[Output("Symb n° 7", LineColor = "Green", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN7 { get; set; }
|
||||
[Output("Symb n° 8", LineColor = "DeepSkyBlue", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN8 { get; set; }
|
||||
[Output("Symb n° 9", LineColor = "Red", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN9 { get; set; }
|
||||
[Output("Symb n° 10", LineColor = "Magenta", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 1)]
|
||||
public IndicatorDataSeries SymbN10 { get; set; }
|
||||
*/
|
||||
|
||||
private MovingAverage[] ma;
|
||||
private AverageTrueRange[] atr;
|
||||
|
||||
private Symbol[] TradeList;
|
||||
private Bars[] bars;
|
||||
private IndicatorDataSeries[] Sources, ResSymbol;
|
||||
private int[] indexBars;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
if (SymbolSelectionMethod == SymbolSelectionMethodType.WatchList)
|
||||
{
|
||||
// Get the trade list from the watchlist provided by the user
|
||||
foreach (Watchlist w in Watchlists)
|
||||
{
|
||||
if (w.Name == WatchlistName)
|
||||
{
|
||||
TradeList = Symbols.GetSymbols(w.SymbolNames.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (SymbolSelectionMethod == SymbolSelectionMethodType.SymbolList)
|
||||
{
|
||||
// Get the trade list from the sysmbol list provided by the user
|
||||
string[] SymbolList = TradedSymbols.ToUpper().Split(' ');
|
||||
|
||||
TradeList = Symbols.GetSymbols(SymbolList);
|
||||
}
|
||||
else
|
||||
{
|
||||
TradeList = new Symbol[1];
|
||||
TradeList[0] = Symbol;
|
||||
}
|
||||
|
||||
atr = new AverageTrueRange[TradeList.Length];
|
||||
ma = new MovingAverage[TradeList.Length];
|
||||
bars = new Bars[TradeList.Length];
|
||||
indexBars = new int[TradeList.Length];
|
||||
Sources = new IndicatorDataSeries[TradeList.Length];
|
||||
ResSymbol = new IndicatorDataSeries[TradeList.Length];
|
||||
|
||||
Print("{0} traded symbols: ", TradeList.Length);
|
||||
|
||||
int i = 0;
|
||||
foreach (var symbol in TradeList)
|
||||
{
|
||||
Print(symbol.Name);
|
||||
|
||||
bars[i] = MarketData.GetBars(Tf, symbol.Name);
|
||||
if (bars[i].OpenTimes[0] > Bars.OpenTimes[0])
|
||||
bars[i].LoadMoreHistory();
|
||||
//Load indicators on start up EP5-ATR
|
||||
Sources[i] = CreateDataSeries();
|
||||
ResSymbol[i] = CreateDataSeries();
|
||||
atr[i] = Indicators.AverageTrueRange(bars[i], 500, MovingAverageType.Simple);
|
||||
|
||||
ma[i] = Indicators.MovingAverage(Sources[i], SmoothPeriods, MaType);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
public override void Calculate(int index)
|
||||
{
|
||||
if (index < SmoothPeriods)
|
||||
return;
|
||||
|
||||
for (int i = 0; i < TradeList.Length; i++)
|
||||
{
|
||||
//indexBars[i] = GetIndexByDate(bars[i], Bars.OpenTimes[index]);
|
||||
|
||||
indexBars[i] = bars[i].OpenTimes.GetIndexByTime(Bars.OpenTimes[index]);
|
||||
Sources[i][index] = bars[i].ClosePrices[indexBars[i]];
|
||||
ResSymbol[i][index] = GetCalculationSymbol(ma[i].Result[index], ma[i].Result[index - LookbackPeriodsAngle], atr[i].Result[indexBars[i]]);
|
||||
}
|
||||
|
||||
SymbN1[index] = ResSymbol[0][index];
|
||||
SymbN2[index] = ResSymbol[1][index];
|
||||
SymbN3[index] = ResSymbol[2][index];
|
||||
SymbN4[index] = ResSymbol[3][index];
|
||||
SymbN5[index] = ResSymbol[4][index];
|
||||
SymbN6[index] = ResSymbol[5][index];
|
||||
|
||||
/* Uncomment For More Symbols on chart
|
||||
SymbN7[index] = ResSymbol[2][index];
|
||||
SymbN8[index] = ResSymbol[3][index];
|
||||
SymbN9[index] = ResSymbol[4][index];
|
||||
SymbN10[index] = ResSymbol[5][index];
|
||||
*/
|
||||
|
||||
IndicatorArea.RemoveAllObjects();
|
||||
|
||||
for (int i = 0; i < TradeList.Length; i++)
|
||||
{
|
||||
IndicatorArea.DrawText((TradeList[i]).ToString() + index, TradeList[i] + " : " + ResSymbol[i][index].ToString("F2"), index, ResSymbol[i][index], ResSymbol[i][index] > ResSymbol[i][index - HistoryTextLookback] ? Color.Lime : Color.Red);
|
||||
}
|
||||
|
||||
}
|
||||
public double GetCalculationSymbol(double priceSmooth, double priceSmoothLoockBack, double atr)
|
||||
{
|
||||
var _momentumpositive = priceSmooth - priceSmoothLoockBack;
|
||||
var _momentumnegative = priceSmoothLoockBack - priceSmooth;
|
||||
var _momentum = priceSmooth > priceSmoothLoockBack
|
||||
? _momentumpositive / atr
|
||||
: _momentumnegative / atr;
|
||||
var _hypothenuse = Math.Sqrt((_momentum * _momentum) + (LookbackPeriodsAngle * LookbackPeriodsAngle));
|
||||
var _cos = (LookbackPeriodsAngle / _hypothenuse);
|
||||
var _angle = priceSmooth > priceSmoothLoockBack
|
||||
? (0 + (Math.Acos(_cos) * 100)) * Sensitivity
|
||||
: (0 - (Math.Acos(_cos) * 100)) * Sensitivity;
|
||||
return _angle;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,9 +0,0 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="cTrader.Automate" Version="1.*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Binary file not shown.
@@ -1,63 +0,0 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
@@ -1,363 +0,0 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
##
|
||||
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||
|
||||
# User-specific files
|
||||
*.rsuser
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Mono auto generated files
|
||||
mono_crash.*
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
[Ww][Ii][Nn]32/
|
||||
[Aa][Rr][Mm]/
|
||||
[Aa][Rr][Mm]64/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]ut/
|
||||
[Ll]og/
|
||||
[Ll]ogs/
|
||||
|
||||
# Visual Studio 2015/2017 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# Visual Studio 2017 auto generated files
|
||||
Generated\ Files/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUnit
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
nunit-*.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# Benchmark Results
|
||||
BenchmarkDotNet.Artifacts/
|
||||
|
||||
# .NET Core
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
# ASP.NET Scaffolding
|
||||
ScaffoldingReadMe.txt
|
||||
|
||||
# StyleCop
|
||||
StyleCopReport.xml
|
||||
|
||||
# Files built by Visual Studio
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_h.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.iobj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.ipdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*_wpftmp.csproj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# Visual Studio Trace Files
|
||||
*.e2e
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# AxoCover is a Code Coverage Tool
|
||||
.axoCover/*
|
||||
!.axoCover/settings.json
|
||||
|
||||
# Coverlet is a free, cross platform Code Coverage Tool
|
||||
coverage*.json
|
||||
coverage*.xml
|
||||
coverage*.info
|
||||
|
||||
# Visual Studio code coverage results
|
||||
*.coverage
|
||||
*.coveragexml
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# Note: Comment the next line if you want to checkin your web deploy settings,
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# NuGet Symbol Packages
|
||||
*.snupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/[Pp]ackages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/[Pp]ackages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/[Pp]ackages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignorable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
*.appx
|
||||
*.appxbundle
|
||||
*.appxupload
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!?*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
orleans.codegen.cs
|
||||
|
||||
# Including strong name files can present a security risk
|
||||
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||
#*.snk
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
ServiceFabricBackup/
|
||||
*.rptproj.bak
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
*.ndf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
*.rptproj.rsuser
|
||||
*- [Bb]ackup.rdl
|
||||
*- [Bb]ackup ([0-9]).rdl
|
||||
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
node_modules/
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||
*.vbw
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# CodeRush personal settings
|
||||
.cr/personal
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
|
||||
# Cake - Uncomment if you are using it
|
||||
# tools/**
|
||||
# !tools/packages.config
|
||||
|
||||
# Tabs Studio
|
||||
*.tss
|
||||
|
||||
# Telerik's JustMock configuration file
|
||||
*.jmconfig
|
||||
|
||||
# BizTalk build output
|
||||
*.btp.cs
|
||||
*.btm.cs
|
||||
*.odx.cs
|
||||
*.xsd.cs
|
||||
|
||||
# OpenCover UI analysis results
|
||||
OpenCover/
|
||||
|
||||
# Azure Stream Analytics local run output
|
||||
ASALocalRun/
|
||||
|
||||
# MSBuild Binary and Structured Log
|
||||
*.binlog
|
||||
|
||||
# NVidia Nsight GPU debugger configuration file
|
||||
*.nvuser
|
||||
|
||||
# MFractors (Xamarin productivity tool) working folder
|
||||
.mfractor/
|
||||
|
||||
# Local History for Visual Studio
|
||||
.localhistory/
|
||||
|
||||
# BeatPulse healthcheck temp database
|
||||
healthchecksdb
|
||||
|
||||
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||
MigrationBackup/
|
||||
|
||||
# Ionide (cross platform F# VS Code tools) working folder
|
||||
.ionide/
|
||||
|
||||
# Fody - auto-generated XML schema
|
||||
FodyWeavers.xsd
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 11.00
|
||||
# Visual Studio 2010
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Economic Events On Chart", "Economic Events On Chart\Economic Events On Chart.csproj", "{7D9A4560-D021-4B46-8D58-83DCBEBBE654}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{7D9A4560-D021-4B46-8D58-83DCBEBBE654}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7D9A4560-D021-4B46-8D58-83DCBEBBE654}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7D9A4560-D021-4B46-8D58-83DCBEBBE654}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7D9A4560-D021-4B46-8D58-83DCBEBBE654}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
-345
@@ -1,345 +0,0 @@
|
||||
using System;
|
||||
using cAlgo.API;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Net;
|
||||
using System.Xml.Serialization;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Linq;
|
||||
using System.Globalization;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.Internet)]
|
||||
public class EconomicEventsOnChart : Indicator
|
||||
{
|
||||
private Color _colorHighImpact, _colorMediumImpact, _colorLowImpact, _colorOthers;
|
||||
|
||||
private TextBlock _textBlock;
|
||||
|
||||
[Parameter("Data URI", DefaultValue = "https://nfs.faireconomy.media/ff_calendar_thisweek.xml", Group = "General")]
|
||||
public string DataUri { get; set; }
|
||||
|
||||
[Parameter("Only Symbol Events", DefaultValue = true, Group = "General")]
|
||||
public bool OnlySymbolEvents { get; set; }
|
||||
|
||||
[Parameter("Show Past Events", DefaultValue = true, Group = "General")]
|
||||
public bool ShowPastEvents { get; set; }
|
||||
|
||||
[Parameter("Show", DefaultValue = true, Group = "High Impact")]
|
||||
public bool ShowHighImpact { get; set; }
|
||||
|
||||
[Parameter("Color", DefaultValue = "Red", Group = "High Impact")]
|
||||
public string ColorHighImpact { get; set; }
|
||||
|
||||
[Parameter("Style", DefaultValue = LineStyle.Solid, Group = "High Impact")]
|
||||
public LineStyle LineStyleHighImpact { get; set; }
|
||||
|
||||
[Parameter("Thickness", DefaultValue = 1, Group = "High Impact")]
|
||||
public int ThicknessHighImpact { get; set; }
|
||||
|
||||
[Parameter("Show", DefaultValue = true, Group = "Medium Impact")]
|
||||
public bool ShowMediumImpact { get; set; }
|
||||
|
||||
[Parameter("Color", DefaultValue = "Gold", Group = "Medium Impact")]
|
||||
public string ColorMediumImpact { get; set; }
|
||||
|
||||
[Parameter("Style", DefaultValue = LineStyle.Solid, Group = "Medium Impact")]
|
||||
public LineStyle LineStyleMediumImpact { get; set; }
|
||||
|
||||
[Parameter("Thickness", DefaultValue = 1, Group = "Medium Impact")]
|
||||
public int ThicknessMediumImpact { get; set; }
|
||||
|
||||
[Parameter("Show", DefaultValue = true, Group = "Low Impact")]
|
||||
public bool ShowLowImpact { get; set; }
|
||||
|
||||
[Parameter("Color", DefaultValue = "Yellow", Group = "Low Impact")]
|
||||
public string ColorLowImpact { get; set; }
|
||||
|
||||
[Parameter("Style", DefaultValue = LineStyle.Solid, Group = "Low Impact")]
|
||||
public LineStyle LineStyleLowImpact { get; set; }
|
||||
|
||||
[Parameter("Thickness", DefaultValue = 1, Group = "Low Impact")]
|
||||
public int ThicknessLowImpact { get; set; }
|
||||
|
||||
[Parameter("Show", DefaultValue = false, Group = "Others")]
|
||||
public bool ShowOthers { get; set; }
|
||||
|
||||
[Parameter("Color", DefaultValue = "Gray", Group = "Others")]
|
||||
public string ColorOthers { get; set; }
|
||||
|
||||
[Parameter("Style", DefaultValue = LineStyle.Solid, Group = "Others")]
|
||||
public LineStyle LineStyleOthers { get; set; }
|
||||
|
||||
[Parameter("Thickness", DefaultValue = 1, Group = "Others")]
|
||||
public int ThicknessOthers { get; set; }
|
||||
|
||||
[Parameter("Show", DefaultValue = true, Group = "Text Block")]
|
||||
public bool ShowTextBlock { get; set; }
|
||||
|
||||
[Parameter("Background Color", DefaultValue = "#969696", Group = "Text Block")]
|
||||
public string TextBlockBackgroundColor { get; set; }
|
||||
|
||||
[Parameter("Color", DefaultValue = "White", Group = "Text Block")]
|
||||
public string TextBlockColor { get; set; }
|
||||
|
||||
[Parameter("Horizontal Alignment", DefaultValue = HorizontalAlignment.Center, Group = "Text Block")]
|
||||
public HorizontalAlignment TextBlockHorizontalAlignment { get; set; }
|
||||
|
||||
[Parameter("Vertical Alignment", DefaultValue = VerticalAlignment.Bottom, Group = "Text Block")]
|
||||
public VerticalAlignment TextBlockVerticalAlignment { get; set; }
|
||||
|
||||
[Parameter("Text Alignment", DefaultValue = TextAlignment.Center, Group = "Text Block")]
|
||||
public TextAlignment TextBlockTextAlignment { get; set; }
|
||||
|
||||
[Parameter("Font Weight", DefaultValue = FontWeight.Bold, Group = "Text Block")]
|
||||
public FontWeight TextBlockFontWeight { get; set; }
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
RemoveEventLines();
|
||||
|
||||
if (ShowTextBlock)
|
||||
{
|
||||
_textBlock = new TextBlock
|
||||
{
|
||||
IsVisible = false,
|
||||
HorizontalAlignment = TextBlockHorizontalAlignment,
|
||||
VerticalAlignment = TextBlockVerticalAlignment,
|
||||
BackgroundColor = GetColor(TextBlockBackgroundColor),
|
||||
ForegroundColor = GetColor(TextBlockColor),
|
||||
TextAlignment = TextBlockTextAlignment,
|
||||
FontWeight = TextBlockFontWeight,
|
||||
Padding = 5
|
||||
};
|
||||
|
||||
Chart.AddControl(_textBlock);
|
||||
|
||||
Chart.ObjectHoverChanged += Chart_ObjectHoverChanged;
|
||||
}
|
||||
|
||||
_colorHighImpact = GetColor(ColorHighImpact);
|
||||
_colorMediumImpact = GetColor(ColorMediumImpact);
|
||||
_colorLowImpact = GetColor(ColorLowImpact);
|
||||
_colorOthers = GetColor(ColorOthers);
|
||||
|
||||
var events = GetNewsEvents();
|
||||
|
||||
DisplayEvents(events);
|
||||
}
|
||||
|
||||
private void Chart_ObjectHoverChanged(ChartObjectHoverChangedEventArgs obj)
|
||||
{
|
||||
if (!obj.IsObjectHovered || obj.ChartObject == null || string.IsNullOrWhiteSpace(obj.ChartObject.Name) || !obj.ChartObject.Name.EndsWith("Event", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
_textBlock.IsVisible = false;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
_textBlock.Text = string.Format("{0} | {1}", obj.ChartObject.Name.Replace(" | Event", string.Empty), obj.ChartObject.Comment);
|
||||
|
||||
_textBlock.IsVisible = true;
|
||||
}
|
||||
|
||||
public override void Calculate(int index)
|
||||
{
|
||||
}
|
||||
|
||||
private IEnumerable<NewsEvent> GetNewsEvents()
|
||||
{
|
||||
using (var webClient = new WebClient())
|
||||
{
|
||||
var data = webClient.DownloadString(DataUri);
|
||||
|
||||
return GetNewsEventsFromXml(data);
|
||||
}
|
||||
}
|
||||
|
||||
private IEnumerable<NewsEvent> GetNewsEventsFromXml(string xml)
|
||||
{
|
||||
var xmlSerializer = new XmlSerializer(typeof(WeeklyEvents));
|
||||
|
||||
var stream = new StringReader(xml);
|
||||
|
||||
var weeklyEvents = xmlSerializer.Deserialize(stream) as WeeklyEvents;
|
||||
|
||||
foreach (var newsEvent in weeklyEvents.Events)
|
||||
{
|
||||
var timeString = string.Format("{0} {1}", newsEvent.UtcDate, newsEvent.UtcTime);
|
||||
|
||||
DateTimeOffset time;
|
||||
|
||||
if (DateTimeOffset.TryParseExact(timeString, "MM-dd-yyyy h:mmtt", CultureInfo.InvariantCulture, DateTimeStyles.AssumeUniversal, out time))
|
||||
{
|
||||
newsEvent.Time = time;
|
||||
}
|
||||
}
|
||||
|
||||
return weeklyEvents.Events;
|
||||
}
|
||||
|
||||
private void DisplayEvents(IEnumerable<NewsEvent> events)
|
||||
{
|
||||
foreach (var newsEvent in events)
|
||||
{
|
||||
if (!newsEvent.Time.HasValue
|
||||
|| (newsEvent.Impact == NewsEventImpact.High && !ShowHighImpact)
|
||||
|| (newsEvent.Impact == NewsEventImpact.Medium && !ShowMediumImpact)
|
||||
|| (newsEvent.Impact == NewsEventImpact.Low && !ShowLowImpact)
|
||||
|| ((newsEvent.Impact == NewsEventImpact.None || newsEvent.Impact == NewsEventImpact.Holiday) && !ShowOthers)
|
||||
|| (OnlySymbolEvents && !IsEventRelatedToSymbol(newsEvent.Currency))
|
||||
|| (!ShowPastEvents && newsEvent.Time < Server.TimeInUtc)) continue;
|
||||
|
||||
var lineSettings = GetLineSettings(newsEvent.Impact);
|
||||
|
||||
var eventLine = Chart.DrawVerticalLine(string.Format("{0} | {1} | {2} | Event", newsEvent.Title, newsEvent.Currency, newsEvent.Impact), newsEvent.Time.Value.UtcDateTime, lineSettings.Color, lineSettings.Thickness, lineSettings.Style);
|
||||
|
||||
var stringBuilder = new StringBuilder();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newsEvent.Forecast))
|
||||
{
|
||||
stringBuilder.Append(string.Format("Forecast: {0} | ", newsEvent.Forecast));
|
||||
}
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(newsEvent.Previous))
|
||||
{
|
||||
stringBuilder.Append(string.Format("Previous: {0} | ", newsEvent.Previous));
|
||||
}
|
||||
|
||||
if (newsEvent.Time.HasValue)
|
||||
{
|
||||
var time = newsEvent.Time.Value.ToOffset(Application.UserTimeOffset);
|
||||
|
||||
stringBuilder.Append(string.Format("Time: {0:s}", time));
|
||||
}
|
||||
|
||||
eventLine.Comment = stringBuilder.ToString();
|
||||
eventLine.IsInteractive = true;
|
||||
eventLine.IsLocked = true;
|
||||
}
|
||||
}
|
||||
|
||||
private bool IsEventRelatedToSymbol(string eventCurrency)
|
||||
{
|
||||
return SymbolName.StartsWith(eventCurrency, StringComparison.OrdinalIgnoreCase) || SymbolName.EndsWith(eventCurrency, StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private Color GetColor(string colorString, int alpha = 255)
|
||||
{
|
||||
var color = colorString[0] == '#' ? Color.FromHex(colorString) : Color.FromName(colorString);
|
||||
|
||||
return Color.FromArgb(alpha, color);
|
||||
}
|
||||
|
||||
private LineSettings GetLineSettings(NewsEventImpact impact)
|
||||
{
|
||||
switch (impact)
|
||||
{
|
||||
case NewsEventImpact.High:
|
||||
return new LineSettings
|
||||
{
|
||||
Color = _colorHighImpact,
|
||||
Style = LineStyleHighImpact,
|
||||
Thickness = ThicknessHighImpact
|
||||
};
|
||||
|
||||
case NewsEventImpact.Medium:
|
||||
return new LineSettings
|
||||
{
|
||||
Color = _colorMediumImpact,
|
||||
Style = LineStyleMediumImpact,
|
||||
Thickness = ThicknessMediumImpact
|
||||
};
|
||||
|
||||
case NewsEventImpact.Low:
|
||||
return new LineSettings
|
||||
{
|
||||
Color = _colorLowImpact,
|
||||
Style = LineStyleLowImpact,
|
||||
Thickness = ThicknessLowImpact
|
||||
};
|
||||
|
||||
default:
|
||||
return new LineSettings
|
||||
{
|
||||
Color = _colorOthers,
|
||||
Style = LineStyleOthers,
|
||||
Thickness = ThicknessOthers
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
private void RemoveEventLines()
|
||||
{
|
||||
var chartObjects = Chart.Objects.ToArray();
|
||||
|
||||
foreach (var chartObject in chartObjects)
|
||||
{
|
||||
if (chartObject.ObjectType != ChartObjectType.VerticalLine || !chartObject.IsInteractive || string.IsNullOrEmpty(chartObject.Name) || !chartObject.Name.EndsWith("Event", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
Chart.RemoveObject(chartObject.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[XmlRoot("weeklyevents")]
|
||||
public class WeeklyEvents
|
||||
{
|
||||
[XmlElement("event")]
|
||||
public List<NewsEvent> Events { get; set; }
|
||||
}
|
||||
|
||||
public class NewsEvent
|
||||
{
|
||||
[XmlElement("title")]
|
||||
public string Title { get; set; }
|
||||
|
||||
[XmlElement("country")]
|
||||
public string Currency { get; set; }
|
||||
|
||||
[XmlElement("date")]
|
||||
public string UtcDate { get; set; }
|
||||
|
||||
[XmlElement("time")]
|
||||
public string UtcTime { get; set; }
|
||||
|
||||
[XmlIgnore]
|
||||
public DateTimeOffset? Time { get; set; }
|
||||
|
||||
[XmlElement("impact")]
|
||||
public NewsEventImpact Impact { get; set; }
|
||||
|
||||
[XmlElement("previous")]
|
||||
public string Previous { get; set; }
|
||||
|
||||
[XmlElement("forecast")]
|
||||
public string Forecast { get; set; }
|
||||
}
|
||||
|
||||
public enum NewsEventImpact
|
||||
{
|
||||
None,
|
||||
|
||||
High,
|
||||
|
||||
Medium,
|
||||
|
||||
Low,
|
||||
|
||||
Holiday
|
||||
}
|
||||
|
||||
public struct LineSettings
|
||||
{
|
||||
public Color Color { get; set; }
|
||||
|
||||
public LineStyle Style { get; set; }
|
||||
|
||||
public int Thickness { get; set; }
|
||||
}
|
||||
}
|
||||
-60
@@ -1,60 +0,0 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<LangVersion>7.2</LangVersion>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{7D9A4560-D021-4B46-8D58-83DCBEBBE654}</ProjectGuid>
|
||||
<ProjectTypeGuids>{DD87C1B2-3799-4CA2-93B6-5288EE928820};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>cAlgo</RootNamespace>
|
||||
<AssemblyName>Economic Events On Chart</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<CheckForOverflowUnderflow>True</CheckForOverflowUnderflow>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="cAlgo.API, Version=1.0.0.0, Culture=neutral, PublicKeyToken=3499da3018340880, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\API\cAlgo.API.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Economic Events On Chart.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
-20
@@ -1,20 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("Economic Events On Chart")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyProduct("Economic Events On Chart")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
[assembly: Guid("35f19c43-c7cc-4f53-b8e0-61caaf9cd8e8")]
|
||||
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
#if DEBUG
|
||||
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations)]
|
||||
#endif
|
||||
Binary file not shown.
@@ -1,9 +1,8 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using cAlgo.API;
|
||||
using cAlgo.API.Indicators;
|
||||
using cAlgo.API.Internals;
|
||||
using Myc.HmaSma;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
@@ -39,7 +38,7 @@ namespace cAlgo
|
||||
private HullMovingAverage _hmaBiasIndicator;
|
||||
private HullMovingAverage _hmaClusterIndicator;
|
||||
|
||||
// Default values from prompt header
|
||||
// Default values
|
||||
private int _smaBiasLength = 200;
|
||||
private int _hmaBiasLength = 250;
|
||||
private int _hmaClusterLength = 25;
|
||||
@@ -48,7 +47,7 @@ namespace cAlgo
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
LoadConfiguration();
|
||||
ApplyExternalConfiguration();
|
||||
|
||||
// Initialize indicators with loaded or default values
|
||||
_smaBiasIndicator = Indicators.SimpleMovingAverage(Bars.ClosePrices, _smaBiasLength);
|
||||
@@ -62,73 +61,39 @@ namespace cAlgo
|
||||
{
|
||||
if (_smaBiasIndicator != null)
|
||||
SmaBiasOutput[index] = _smaBiasIndicator.Result[index];
|
||||
|
||||
|
||||
if (_hmaBiasIndicator != null)
|
||||
HmaBiasOutput[index] = _hmaBiasIndicator.Result[index];
|
||||
|
||||
|
||||
if (_hmaClusterIndicator != null)
|
||||
HmaClusterOutput[index] = _hmaClusterIndicator.Result[index];
|
||||
}
|
||||
|
||||
private void LoadConfiguration()
|
||||
private void ApplyExternalConfiguration()
|
||||
{
|
||||
if (!File.Exists(ConfigFilePath))
|
||||
{
|
||||
Print($"Config file not found at {ConfigFilePath}. Using defaults.");
|
||||
return;
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
var lines = File.ReadAllLines(ConfigFilePath);
|
||||
var currentSymbol = SymbolName;
|
||||
// cTrader ShortName returns "m5", "h1", etc. which matches your file format
|
||||
var currentTimeframe = TimeFrame.ShortName;
|
||||
var loader = new HmaSmaLoader(ConfigFilePath);
|
||||
loader.Load();
|
||||
|
||||
foreach (var line in lines)
|
||||
// cTrader TimeFrame.ShortName returns values like "m5", "h1" which match the library expectation
|
||||
var parameters = loader.GetParameters(SymbolName, TimeFrame.ShortName);
|
||||
|
||||
if (parameters != null)
|
||||
{
|
||||
var trimmedLine = line.Trim();
|
||||
|
||||
// Skip comments and empty lines
|
||||
if (string.IsNullOrWhiteSpace(trimmedLine) || trimmedLine.StartsWith("#"))
|
||||
continue;
|
||||
|
||||
// Split by whitespace
|
||||
var columns = trimmedLine.Split(new[] { ' ', '\t' }, StringSplitOptions.RemoveEmptyEntries);
|
||||
|
||||
// Ensure we have enough columns (need at least up to index 6)
|
||||
if (columns.Length < 7)
|
||||
continue;
|
||||
|
||||
var cfgSymbol = columns[0];
|
||||
var cfgTimeframe = columns[1];
|
||||
|
||||
// Check for match (case-insensitive)
|
||||
if (string.Equals(cfgSymbol, currentSymbol, StringComparison.OrdinalIgnoreCase) &&
|
||||
string.Equals(cfgTimeframe, currentTimeframe, StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
// Parse values
|
||||
// Col 4: SmaBias
|
||||
// Col 5: HmaBias
|
||||
// Col 6: HmaCluster
|
||||
if (int.TryParse(columns[4], out int sBias) &&
|
||||
int.TryParse(columns[5], out int hBias) &&
|
||||
int.TryParse(columns[6], out int hCluster))
|
||||
{
|
||||
_smaBiasLength = sBias;
|
||||
_hmaBiasLength = hBias;
|
||||
_hmaClusterLength = hCluster;
|
||||
Print($"Configuration found for {currentSymbol} {currentTimeframe}");
|
||||
return; // Stop searching after match
|
||||
}
|
||||
}
|
||||
_smaBiasLength = parameters.SmaBias;
|
||||
_hmaBiasLength = parameters.HmaBias;
|
||||
_hmaClusterLength = parameters.HmaCluster;
|
||||
Print($"Configuration loaded for {SymbolName} {TimeFrame.ShortName}");
|
||||
}
|
||||
else
|
||||
{
|
||||
Print($"No specific config found for {SymbolName} {TimeFrame.ShortName}. Using defaults.");
|
||||
}
|
||||
|
||||
Print($"No specific config found for {currentSymbol} {currentTimeframe}. Using defaults.");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Print($"Error reading config file: {ex.Message}. Using defaults.");
|
||||
Print($"Error loading configuration: {ex.Message}. Using defaults.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="cTrader.Automate" Version="*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<Reference Include="MSLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\..\..\Common\MSLib\obj\Debug\net6.0\MSLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Binary file not shown.
@@ -0,0 +1 @@
|
||||
{"version":"2.0.0","tasks":[{"label":"build","command":"dotnet","type":"process","args":["build","${workspaceFolder}","/property:GenerateFullPaths=true","/consoleLoggerParameters:NoSummary"],"problemMatcher":"$msCompile"}]}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="cTrader.Automate" Version="*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
<ItemGroup>
|
||||
<Reference Include="MSLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null">
|
||||
<HintPath>..\..\..\Common\MSLib\obj\Debug\net6.0\MSLib.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// <autogenerated />
|
||||
using System;
|
||||
using System.Reflection;
|
||||
[assembly: global::System.Runtime.Versioning.TargetFrameworkAttribute(".NETCoreApp,Version=v6.0", FrameworkDisplayName = "")]
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
using System;
|
||||
using System.Reflection;
|
||||
|
||||
[assembly: System.Reflection.AssemblyCompanyAttribute("HmaClusterSR")]
|
||||
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
|
||||
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
|
||||
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
|
||||
[assembly: System.Reflection.AssemblyProductAttribute("HmaClusterSR")]
|
||||
[assembly: System.Reflection.AssemblyTitleAttribute("HmaClusterSR")]
|
||||
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]
|
||||
|
||||
// Generated by the MSBuild WriteCodeFragment class.
|
||||
|
||||
+1
@@ -0,0 +1 @@
|
||||
9e01ea14fd7f1cf3abff0b8c1e9bec07e427b59e
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
is_global = true
|
||||
build_property.TargetFramework = net6.0
|
||||
build_property.TargetPlatformMinVersion =
|
||||
build_property.UsingMicrosoftNETSdkWeb =
|
||||
build_property.ProjectTypeGuids =
|
||||
build_property.InvariantGlobalization =
|
||||
build_property.PlatformNeutralAssembly =
|
||||
build_property._SupportedPlatformList = Linux,macOS,Windows
|
||||
build_property.RootNamespace = HmaClusterSR
|
||||
build_property.ProjectDir = C:\Users\Brummel\Documents\cAlgo\Sources\Indicators\HmaClusterSR\HmaClusterSR\
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
+66
@@ -0,0 +1,66 @@
|
||||
{
|
||||
"format": 1,
|
||||
"restore": {
|
||||
"C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj": {}
|
||||
},
|
||||
"projects": {
|
||||
"C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj",
|
||||
"projectName": "HmaClusterSR",
|
||||
"projectPath": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj",
|
||||
"packagesPath": "C:\\Users\\Brummel\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Brummel\\AppData\\Roaming\\NuGet\\NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"cTrader.Automate": {
|
||||
"target": "Package",
|
||||
"version": "[*, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.200\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<RestoreSuccess Condition=" '$(RestoreSuccess)' == '' ">True</RestoreSuccess>
|
||||
<RestoreTool Condition=" '$(RestoreTool)' == '' ">NuGet</RestoreTool>
|
||||
<ProjectAssetsFile Condition=" '$(ProjectAssetsFile)' == '' ">$(MSBuildThisFileDirectory)project.assets.json</ProjectAssetsFile>
|
||||
<NuGetPackageRoot Condition=" '$(NuGetPackageRoot)' == '' ">$(UserProfile)\.nuget\packages\</NuGetPackageRoot>
|
||||
<NuGetPackageFolders Condition=" '$(NuGetPackageFolders)' == '' ">C:\Users\Brummel\.nuget\packages\</NuGetPackageFolders>
|
||||
<NuGetProjectStyle Condition=" '$(NuGetProjectStyle)' == '' ">PackageReference</NuGetProjectStyle>
|
||||
<NuGetToolVersion Condition=" '$(NuGetToolVersion)' == '' ">6.1.0</NuGetToolVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<SourceRoot Include="C:\Users\Brummel\.nuget\packages\" />
|
||||
</ItemGroup>
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)ctrader.automate\1.0.14\build\cTrader.Automate.props" Condition="Exists('$(NuGetPackageRoot)ctrader.automate\1.0.14\build\cTrader.Automate.props')" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<PkgcTrader_Automate Condition=" '$(PkgcTrader_Automate)' == '' ">C:\Users\Brummel\.nuget\packages\ctrader.automate\1.0.14</PkgcTrader_Automate>
|
||||
</PropertyGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8" standalone="no"?>
|
||||
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ImportGroup Condition=" '$(ExcludeRestorePackageImports)' != 'true' ">
|
||||
<Import Project="$(NuGetPackageRoot)ctrader.automate\1.0.14\build\cTrader.Automate.targets" Condition="Exists('$(NuGetPackageRoot)ctrader.automate\1.0.14\build\cTrader.Automate.targets')" />
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
@@ -0,0 +1,139 @@
|
||||
{
|
||||
"version": 3,
|
||||
"targets": {
|
||||
"net6.0": {
|
||||
"cTrader.Automate/1.0.14": {
|
||||
"type": "package",
|
||||
"compile": {
|
||||
"lib/net6.0/cAlgo.API.dll": {}
|
||||
},
|
||||
"runtime": {
|
||||
"lib/net6.0/cAlgo.API.dll": {}
|
||||
},
|
||||
"build": {
|
||||
"build/cTrader.Automate.props": {},
|
||||
"build/cTrader.Automate.targets": {}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"libraries": {
|
||||
"cTrader.Automate/1.0.14": {
|
||||
"sha512": "eNwE7WL90MGBKb5MuLAtZLdQy0vxkI5EVhLWAQ9S83EAdYkGAzdccvGFLk2oqmtSGBtD+gEpyrJUW/ej4dI4jw==",
|
||||
"type": "package",
|
||||
"path": "ctrader.automate/1.0.14",
|
||||
"hasTools": true,
|
||||
"files": [
|
||||
".nupkg.metadata",
|
||||
".signature.p7s",
|
||||
"build/cTrader.Automate.props",
|
||||
"build/cTrader.Automate.targets",
|
||||
"ctrader.automate.1.0.14.nupkg.sha512",
|
||||
"ctrader.automate.nuspec",
|
||||
"eula.md",
|
||||
"icon.png",
|
||||
"lib/net40/cAlgo.API.dll",
|
||||
"lib/net40/cAlgo.API.xml",
|
||||
"lib/net6.0/cAlgo.API.dll",
|
||||
"lib/net6.0/cAlgo.API.xml",
|
||||
"tools/net472/Core.AlgoFormat.Compose.Reflection.dll",
|
||||
"tools/net472/Core.AlgoFormat.Writer.dll",
|
||||
"tools/net472/Core.AlgoFormat.dll",
|
||||
"tools/net472/Core.Domain.Primitives.dll",
|
||||
"tools/net472/Newtonsoft.Json.dll",
|
||||
"tools/net472/System.Buffers.dll",
|
||||
"tools/net472/System.Collections.Immutable.dll",
|
||||
"tools/net472/System.Memory.dll",
|
||||
"tools/net472/System.Numerics.Vectors.dll",
|
||||
"tools/net472/System.Reflection.Metadata.dll",
|
||||
"tools/net472/System.Reflection.MetadataLoadContext.dll",
|
||||
"tools/net472/System.Runtime.CompilerServices.Unsafe.dll",
|
||||
"tools/net472/cTrader.Automate.Sdk.Tasks.dll",
|
||||
"tools/net6.0/Core.AlgoFormat.Compose.Reflection.dll",
|
||||
"tools/net6.0/Core.AlgoFormat.Writer.dll",
|
||||
"tools/net6.0/Core.AlgoFormat.dll",
|
||||
"tools/net6.0/Core.Connection.Protobuf.Common.dll",
|
||||
"tools/net6.0/Core.Domain.Primitives.dll",
|
||||
"tools/net6.0/Microsoft.Win32.SystemEvents.dll",
|
||||
"tools/net6.0/Newtonsoft.Json.dll",
|
||||
"tools/net6.0/System.Drawing.Common.dll",
|
||||
"tools/net6.0/System.Reflection.MetadataLoadContext.dll",
|
||||
"tools/net6.0/System.Security.Permissions.dll",
|
||||
"tools/net6.0/System.Windows.Extensions.dll",
|
||||
"tools/net6.0/cTrader.Automate.Sdk.Tasks.dll",
|
||||
"tools/net6.0/protobuf-net.Core.dll",
|
||||
"tools/net6.0/protobuf-net.dll",
|
||||
"tools/net6.0/runtimes/unix/lib/net6.0/System.Drawing.Common.dll",
|
||||
"tools/net6.0/runtimes/win/lib/net6.0/Microsoft.Win32.SystemEvents.dll",
|
||||
"tools/net6.0/runtimes/win/lib/net6.0/System.Drawing.Common.dll",
|
||||
"tools/net6.0/runtimes/win/lib/net6.0/System.Windows.Extensions.dll"
|
||||
]
|
||||
}
|
||||
},
|
||||
"projectFileDependencyGroups": {
|
||||
"net6.0": [
|
||||
"cTrader.Automate >= *"
|
||||
]
|
||||
},
|
||||
"packageFolders": {
|
||||
"C:\\Users\\Brummel\\.nuget\\packages\\": {}
|
||||
},
|
||||
"project": {
|
||||
"version": "1.0.0",
|
||||
"restore": {
|
||||
"projectUniqueName": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj",
|
||||
"projectName": "HmaClusterSR",
|
||||
"projectPath": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj",
|
||||
"packagesPath": "C:\\Users\\Brummel\\.nuget\\packages\\",
|
||||
"outputPath": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\obj\\",
|
||||
"projectStyle": "PackageReference",
|
||||
"configFilePaths": [
|
||||
"C:\\Users\\Brummel\\AppData\\Roaming\\NuGet\\NuGet.Config"
|
||||
],
|
||||
"originalTargetFrameworks": [
|
||||
"net6.0"
|
||||
],
|
||||
"sources": {
|
||||
"https://api.nuget.org/v3/index.json": {}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"projectReferences": {}
|
||||
}
|
||||
},
|
||||
"warningProperties": {
|
||||
"warnAsError": [
|
||||
"NU1605"
|
||||
]
|
||||
}
|
||||
},
|
||||
"frameworks": {
|
||||
"net6.0": {
|
||||
"targetAlias": "net6.0",
|
||||
"dependencies": {
|
||||
"cTrader.Automate": {
|
||||
"target": "Package",
|
||||
"version": "[*, )"
|
||||
}
|
||||
},
|
||||
"imports": [
|
||||
"net461",
|
||||
"net462",
|
||||
"net47",
|
||||
"net471",
|
||||
"net472",
|
||||
"net48"
|
||||
],
|
||||
"assetTargetFallback": true,
|
||||
"warn": true,
|
||||
"frameworkReferences": {
|
||||
"Microsoft.NETCore.App": {
|
||||
"privateAssets": "all"
|
||||
}
|
||||
},
|
||||
"runtimeIdentifierGraphPath": "C:\\Program Files\\dotnet\\sdk\\6.0.200\\RuntimeIdentifierGraph.json"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"version": 2,
|
||||
"dgSpecHash": "44vzUq/Lw+XLcrX6CWh7QZnxKTbL7SBSGBbM9ijWJIaHajpDybp1KWXAjmIYPIEKiHbzs2dgB4Wmenl5+uQxng==",
|
||||
"success": true,
|
||||
"projectFilePath": "C:\\Users\\Brummel\\Documents\\cAlgo\\Sources\\Indicators\\HmaClusterSR\\HmaClusterSR\\HmaClusterSR.csproj",
|
||||
"expectedPackageFiles": [
|
||||
"C:\\Users\\Brummel\\.nuget\\packages\\ctrader.automate\\1.0.14\\ctrader.automate.1.0.14.nupkg.sha512"
|
||||
],
|
||||
"logs": []
|
||||
}
|
||||
Reference in New Issue
Block a user