Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.31729.503
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Sample Alligator", "Sample Alligator\Sample Alligator.csproj", "{D11E711B-6CE5-42A2-BD07-F25907198272}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{D11E711B-6CE5-42A2-BD07-F25907198272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D11E711B-6CE5-42A2-BD07-F25907198272}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D11E711B-6CE5-42A2-BD07-F25907198272}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D11E711B-6CE5-42A2-BD07-F25907198272}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {F5EF3993-F32A-48D0-A3D9-C1F8B25B02A8}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,63 @@
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
//
|
||||
// This code is a cTrader Automate API example.
|
||||
//
|
||||
// All changes to this file might be lost on the next application update.
|
||||
// If you are going to modify this file please make a copy using the "Duplicate" command.
|
||||
//
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
|
||||
using cAlgo.API;
|
||||
using cAlgo.API.Indicators;
|
||||
|
||||
namespace cAlgo
|
||||
{
|
||||
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)]
|
||||
public class SampleAlligator : Indicator
|
||||
{
|
||||
[Parameter("Periods", Group = "Jaws", DefaultValue = 13)]
|
||||
public int JawsPeriods { get; set; }
|
||||
|
||||
[Parameter("Shift", Group = "Jaws", DefaultValue = 8)]
|
||||
public int JawsShift { get; set; }
|
||||
|
||||
[Parameter("Periods", Group = "Teeth", DefaultValue = 8)]
|
||||
public int TeethPeriods { get; set; }
|
||||
|
||||
[Parameter("Shift", Group = "Teeth", DefaultValue = 5)]
|
||||
public int TeethShift { get; set; }
|
||||
|
||||
[Parameter("Periods", Group = "Lips", DefaultValue = 5)]
|
||||
public int LipsPeriods { get; set; }
|
||||
|
||||
[Parameter("Shift", Group = "Lips", DefaultValue = 3)]
|
||||
public int LipsShift { get; set; }
|
||||
|
||||
[Output("Jaws", LineColor = "Blue")]
|
||||
public IndicatorDataSeries Jaws { get; set; }
|
||||
|
||||
[Output("Teeth", LineColor = "Red")]
|
||||
public IndicatorDataSeries Teeth { get; set; }
|
||||
|
||||
[Output("Lips", LineColor = "Lime")]
|
||||
public IndicatorDataSeries Lips { get; set; }
|
||||
|
||||
private WellesWilderSmoothing jawsMa;
|
||||
private WellesWilderSmoothing teethMa;
|
||||
private WellesWilderSmoothing lipsMa;
|
||||
|
||||
protected override void Initialize()
|
||||
{
|
||||
jawsMa = Indicators.WellesWilderSmoothing(Bars.MedianPrices, JawsPeriods);
|
||||
teethMa = Indicators.WellesWilderSmoothing(Bars.MedianPrices, TeethPeriods);
|
||||
lipsMa = Indicators.WellesWilderSmoothing(Bars.MedianPrices, LipsPeriods);
|
||||
}
|
||||
|
||||
public override void Calculate(int index)
|
||||
{
|
||||
Jaws[index + JawsShift] = jawsMa.Result[index];
|
||||
Teeth[index + TeethShift] = teethMa.Result[index];
|
||||
Lips[index + LipsShift] = lipsMa.Result[index];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<PropertyGroup>
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="cTrader.Automate" Version="1.*-*" />
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
Reference in New Issue
Block a user