//#region Using declarations //using System; //using System.Collections.Generic; //using System.ComponentModel; //using System.ComponentModel.DataAnnotations; //using System.Linq; //using System.Text; //using System.Threading.Tasks; //using System.Windows; //using System.Windows.Input; //using System.Windows.Media; //using System.Xml.Serialization; //using NinjaTrader.Cbi; //using NinjaTrader.Gui; //using NinjaTrader.Gui.Chart; //using NinjaTrader.Gui.SuperDom; //using NinjaTrader.Gui.Tools; //using NinjaTrader.Data; //using NinjaTrader.NinjaScript; //using NinjaTrader.Core.FloatingPoint; //using NinjaTrader.NinjaScript.Indicators; //using NinjaTrader.NinjaScript.DrawingTools; //#endregion ////This namespace holds Strategies in this folder and is required. Do not change it. //namespace NinjaTrader.NinjaScript.Strategies //{ // public class ema : Strategy // { // private bool DaysOk; // private int Trend; // private EMASlopeColor EMASlopeColor1; // private EMA EMA1; // protected override void OnStateChange() // { // if (State == State.SetDefaults) // { // Description = @"Enter the description for your new custom Strategy here."; // Name = "ema"; // Calculate = Calculate.OnBarClose; // EntriesPerDirection = 1; // EntryHandling = EntryHandling.AllEntries; // IsExitOnSessionCloseStrategy = true; // ExitOnSessionCloseSeconds = 30; // IsFillLimitOnTouch = false; // MaximumBarsLookBack = MaximumBarsLookBack.Infinite; // OrderFillResolution = OrderFillResolution.Standard; // Slippage = 0; // StartBehavior = StartBehavior.WaitUntilFlat; // TimeInForce = TimeInForce.Gtc; // TraceOrders = false; // RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose; // StopTargetHandling = StopTargetHandling.PerEntryExecution; // BarsRequiredToTrade = 20; // // Disable this property for performance gains in Strategy Analyzer optimizations // // See the Help Guide for additional information // IsInstantiatedOnEachOptimizationIteration = true; // Profit = 0.02; // Loss = 0.01; // QuantityStocks = 100; // TimeOpen = DateTime.Parse("09:30", System.Globalization.CultureInfo.InvariantCulture); // Timeclose = DateTime.Parse("17:00", System.Globalization.CultureInfo.InvariantCulture); // Ema20 = 20; // Umbralup = 2; // UmbralDown = 2; // DaysOk = true; // Trend = 0; // } // else if (State == State.Configure) // { // } // else if (State == State.DataLoaded) // { // EMASlopeColor1 = EMASlopeColor(Close, Convert.ToInt32(Ema20), Brushes.LimeGreen, Brushes.Red, true); // EMA1 = EMA(Close, Convert.ToInt32(Ema20)); // EMASlopeColor1.Plots[0].Brush = Brushes.Orange; // AddChartIndicator(EMASlopeColor1); // } // } // protected override void OnBarUpdate() // { // if (BarsInProgress != 0) // return; // if (CurrentBars[0] < 1) // return; // // Set 1 // if ((Times[0][0].TimeOfDay >= TimeOpen.TimeOfDay) // && (Times[0][0].TimeOfDay <= Timeclose.TimeOfDay) // && (DaysOk == true) // && (Close[0] > (EMASlopeColor1[0] + (Umbralup))) // && (Trend == 1)) // { // EnterLong(Convert.ToInt32(QuantityStocks), @"buy"); // Trend = 2; // } // // Set 2 // if ((Times[0][0].TimeOfDay >= TimeOpen.TimeOfDay) // && (Times[0][0].TimeOfDay <= Timeclose.TimeOfDay) // && (DaysOk == true) // && (Close[0] < (EMASlopeColor1[0] - (UmbralDown))) // && (Trend == 2)) // { // EnterShort(Convert.ToInt32(QuantityStocks), @"sell"); // Trend = 1; // } // // Set 3 // if (Times[0][0].TimeOfDay < Times[0][1].TimeOfDay) // { // DaysOk = true; // } // // Set 4 // if ((Position.MarketPosition == MarketPosition.Long) // && (High[0] < EMA1[0])) // { // ExitLong(Convert.ToInt32(QuantityStocks), "", ""); // } // // Set 5 // if ((Position.MarketPosition == MarketPosition.Short) // && (Low[0] > EMA1[0])) // { // ExitShort(Convert.ToInt32(QuantityStocks), "", ""); // } // // Set 6 // if ((Times[0][0].TimeOfDay >= TimeOpen.TimeOfDay) // && (Times[0][0].TimeOfDay <= Timeclose.TimeOfDay) // && (DaysOk == true) // && (Close[0] > (EMASlopeColor1[0] + (Umbralup))) // && (Trend == 0)) // { // EnterLong(Convert.ToInt32(QuantityStocks), @"buy"); // Trend = 2; // } // // Set 7 // if ((Times[0][0].TimeOfDay >= TimeOpen.TimeOfDay) // && (Times[0][0].TimeOfDay <= Timeclose.TimeOfDay) // && (DaysOk == true) // && (Close[0] < (EMASlopeColor1[0] - (UmbralDown))) // && (Trend == 0)) // { // EnterShort(Convert.ToInt32(QuantityStocks), @"sell"); // Trend = 1; // } // // Set 8 // if (Position.MarketPosition == MarketPosition.Flat) // { // Trend = 0; // } // } // #region Properties // [NinjaScriptProperty] // [Range(0.001, double.MaxValue)] // [Display(Name = "Profit", Order = 1, GroupName = "Parameters")] // public double Profit // { get; set; } // [NinjaScriptProperty] // [Range(0.001, double.MaxValue)] // [Display(Name = "Loss", Order = 2, GroupName = "Parameters")] // public double Loss // { get; set; } // [NinjaScriptProperty] // [Range(1, double.MaxValue)] // [Display(Name = "QuantityStocks", Order = 3, GroupName = "Parameters")] // public double QuantityStocks // { get; set; } // [NinjaScriptProperty] // [PropertyEditor("NinjaTrader.Gui.Tools.TimeEditorKey")] // [Display(Name = "TimeOpen", Order = 4, GroupName = "Parameters")] // public DateTime TimeOpen // { get; set; } // [NinjaScriptProperty] // [PropertyEditor("NinjaTrader.Gui.Tools.TimeEditorKey")] // [Display(Name = "Timeclose", Order = 5, GroupName = "Parameters")] // public DateTime Timeclose // { get; set; } // [NinjaScriptProperty] // [Range(1, int.MaxValue)] // [Display(Name = "Ema20", Order = 6, GroupName = "Parameters")] // public int Ema20 // { get; set; } // [NinjaScriptProperty] // [Range(0, double.MaxValue)] // [Display(Name = "Umbralup", Order = 7, GroupName = "Parameters")] // public double Umbralup // { get; set; } // [NinjaScriptProperty] // [Range(0, double.MaxValue)] // [Display(Name = "UmbralDown", Order = 8, GroupName = "Parameters")] // public double UmbralDown // { get; set; } // #endregion // } //} //#region Wizard settings, neither change nor remove ///*@ // // // OnBarClose // // // // // // false // true // Enter long position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2019-10-30T21:27:20.3462958 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // 0 // buy // // // // // // // // // 0 // Set Enter long position // // // // BottomLeft // 2019-10-30T21:27:10.6892054 // false // // Enter // // EnterLong // // quantity // signalName // // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:17:00.8573374 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 2 // // 2020-04-30T22:17:00.8573374 // false // // SetValue // int // Trend // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:17:00.8573374 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 2 // // 2020-04-30T22:17:00.8573374 // false // // SetValue // int // Trend // // All // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:27:45.57583 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // GreaterEqual // // // false // true // TimeOpen // Arithmetic // // TimeOpen.TimeOfDay // // // 0 // Currency // 2019-10-27T17:44:20.2515116 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay >= TimeOpen.TimeOfDay // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:28:43.6463056 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // LessEqual // // // false // true // Timeclose // Arithmetic // // Timeclose.TimeOfDay // // // 0 // Currency // 2019-10-27T17:45:43.8532844 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay <= Timeclose.TimeOfDay // // // Any // // // // // false // true // DaysOk // Arithmetic // // DaysOk // // // 0 // Currency // 2019-10-24T21:34:49.4666987 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // 1 // Equals // // // false // true // True // Arithmetic // // true // // // 0 // Currency // 2019-10-24T21:34:49.4746926 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // // // false // DaysOk = true // // // Any // // // // // true // true // Close // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-04-30T21:44:08.0700822 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // 1 // Greater // // // true // true // EMASlopeColor // Arithmetic // // EMASlopeColor // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-04-30T21:44:50.1491985 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // UpColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 50 // 205 // 50 // 1 // 0.0318960324 // 0.610495567 // 0.0318960324 // // // // // // // DnColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 255 // 0 // 0 // 1 // 1 // 0 // 0 // // // // // // // ColorSlope // // // true // // // // // EMASlopeColor // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFFFA500</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA_Slope_Color // Line // // // // false // false // true // Close // Indicator // EMA_Slope_Color // // 0 // Currency // 2020-04-30T21:44:08.0940666 // Sunday // 0 // false // 0 // Long // // // false // 0 // Add // Arithmetic // // // 0 // false // // // false // true // Umbralup // Arithmetic // // Umbralup // // // 0 // Currency // 2020-04-30T21:46:33.3326486 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // Umbralup // // // 0 // Series // 0 // Undefined // // // // // false // Default input[0] > (EMASlopeColor(Ema20, Brushes.LimeGreen, Brushes.Red, true)[0] + (Umbralup)) // // // Any // // // // // true // true // Trend // Arithmetic // // Trend // // // 0 // Currency // 2020-04-30T22:07:03.9614788 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // 1 // Equals // // // true // true // Numeric value // Arithmetic // // {0} // // NumericValue // // // 0 // Currency // 2020-04-30T22:07:03.9834638 // Sunday // 0 // false // 0 // Long // // 0 // false // true // 1 // // 0 // Number // 0 // Undefined // // // // // false // Trend = 1 // // // Set 1 // 1 // // // // // // false // true // Enter short position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2019-10-30T21:26:07.2673022 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // 0 // sell // // // // // // // // // 0 // Set Enter short position // // // // BottomLeft // 2019-10-30T21:25:56.1800133 // false // // Enter // // EnterShort // // quantity // signalName // // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:16:21.4793875 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 1 // // 2020-04-30T22:16:21.4793875 // false // // SetValue // int // Trend // // // All // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:27:45.57583 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // GreaterEqual // // // false // true // TimeOpen // Arithmetic // // TimeOpen.TimeOfDay // // // 0 // Currency // 2019-10-27T17:44:34.898231 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay >= TimeOpen.TimeOfDay // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:28:43.6463056 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // LessEqual // // // false // true // Timeclose // Arithmetic // // Timeclose.TimeOfDay // // // 0 // Currency // 2019-10-27T17:46:04.2758117 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay <= Timeclose.TimeOfDay // // // Any // // // // // false // true // DaysOk // Arithmetic // // DaysOk // // // 0 // Currency // 2019-10-24T21:35:28.5013276 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // 1 // Equals // // // false // true // True // Arithmetic // // true // // // 0 // Currency // 2019-10-24T21:35:28.50932 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // // // false // DaysOk = true // // // Any // // // // // true // true // Close // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-04-30T21:44:08.0700822 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // 1 // Less // // // true // true // EMASlopeColor // Arithmetic // // EMASlopeColor // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-04-30T21:44:50.1491985 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // UpColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 50 // 205 // 50 // 1 // 0.0318960324 // 0.610495567 // 0.0318960324 // // // // // // // DnColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 255 // 0 // 0 // 1 // 1 // 0 // 0 // // // // // // // ColorSlope // // // true // // // // // EMASlopeColor // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFFFA500</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA_Slope_Color // Line // // // // false // false // false // Close // Indicator // EMA_Slope_Color // // 0 // Currency // 2020-04-30T21:44:08.0940666 // Sunday // 0 // false // 0 // Long // // // false // 0 // Subtract // Arithmetic // // // 0 // false // // // false // true // UmbralDown // Arithmetic // // UmbralDown // // // 0 // Currency // 2020-04-30T21:45:43.6921138 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // UmbralDown // // // 0 // Series // 0 // Undefined // // // // // false // Default input[0] < (EMASlopeColor(Ema20, Brushes.LimeGreen, Brushes.Red, true)[0] - (UmbralDown)) // // // Any // // // // // true // true // Trend // Arithmetic // // Trend // // // 0 // Currency // 2020-04-30T22:07:21.1659007 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // 1 // Equals // // // true // true // Numeric value // Arithmetic // // {0} // // NumericValue // // // 0 // Currency // 2020-04-30T22:07:21.1898845 // Sunday // 0 // false // 0 // Long // // 0 // false // true // 2 // // 0 // Number // 0 // Undefined // // // // // false // Trend = 2 // // // Set 2 // 2 // // // // // // false // true // Set DaysOk // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2019-10-24T21:30:02.4402679 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // 2019-10-24T21:30:02.4402679 // true // // SetValue // bool // DaysOk // // // All // // // Any // // // // // false // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-08T19:21:52.7583883 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // Less // // // false // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 1 // Currency // 2019-10-08T19:21:52.7773554 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay < Times[Default input][1].TimeOfDay // // // Set 3 // 3 // // // // // // false // true // Exit long position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2020-04-30T21:52:40.423297 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // // 0 // Set Exit long position // // // // BottomLeft // 2020-04-30T21:52:30.6644481 // false // // Exit // // ExitLong // // quantity // signalName // fromEntrySignal // // // // // All // // // Any // // // // // false // true // Current market position // Arithmetic // // Position.MarketPosition // // // 0 // Currency // 2020-04-30T21:52:05.9136945 // Sunday // 0 // false // 0 // Long // 0 // MarketData // 0 // Undefined // // // 1 // Equals // // // false // true // Market position // Arithmetic // // MarketPosition.{0} // // MarketPosition // // // 0 // Currency // 2020-04-30T21:52:05.9396771 // Sunday // 0 // false // 0 // Long // 0 // MarketData // 0 // Undefined // // // // // false // Position.MarketPosition = MarketPosition.Long // // // Any // // // // false // true // High // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-05-01T15:37:14.9414583 // Sunday // 0 // false // 0 // Long // 0 // Series // // DataSeries DefaultSeries // // false // true // false // High // DefaultSeries // // 0 // Undefined // // // 1 // Less // // true // true // EMA // Arithmetic // // EMA // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-05-01T15:17:24.1654308 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // EMA // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFDAA520</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA // Line // // // // false // false // false // Close // Indicator // // 0 // Currency // 2020-05-01T15:16:33.3355675 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // // // false // High[0] < EMA(Ema20)[0] // // // Set 4 // 4 // // // // // // false // true // Exit short position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2020-04-30T21:55:27.7914427 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // // 0 // Set Exit short position // // // // BottomLeft // 2020-04-30T21:55:13.8785249 // false // // Exit // // ExitShort // // quantity // signalName // fromEntrySignal // // // // // // // false // true // Exit short position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2020-04-30T21:55:27.7914427 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // // 0 // Set Exit short position // // // // BottomLeft // 2020-04-30T21:55:13.8785249 // false // // Exit // // ExitShort // // quantity // signalName // fromEntrySignal // // // // All // // // Any // // // // // true // true // Current market position // Arithmetic // // Position.MarketPosition // // // 0 // Currency // 2020-04-30T21:52:05.9136945 // Sunday // 0 // false // 0 // Long // 0 // MarketData // 0 // Undefined // // // 1 // Equals // // // true // true // Market position // Arithmetic // // MarketPosition.{0} // // MarketPosition // // // 0 // Currency // 2020-04-30T21:52:05.9396771 // Sunday // 0 // false // 0 // Short // 0 // MarketData // 0 // Undefined // // // // // false // Position.MarketPosition = MarketPosition.Short // // // Any // // // // false // true // Low // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-05-01T15:37:39.3872937 // Sunday // 0 // false // 0 // Long // 0 // Series // // DataSeries DefaultSeries // // false // true // false // Low // DefaultSeries // // 0 // Undefined // // // 1 // Greater // // // true // true // EMA // Arithmetic // // EMA // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-05-01T15:17:24.1654308 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // EMA // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFDAA520</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA // Line // // // // false // false // false // Close // Indicator // // 0 // Currency // 2020-05-01T15:16:33.3355675 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // // // false // Low[0] > EMA(Ema20)[0] // // // Set 5 // 5 // // // // // // false // true // Enter long position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2019-10-30T21:27:20.3462958 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // 0 // buy // // // // // // // // // 0 // Set Enter long position // // // // BottomLeft // 2019-10-30T21:27:10.6892054 // false // // Enter // // EnterLong // // quantity // signalName // // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:17:00.8573374 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 2 // // 2020-04-30T22:17:00.8573374 // false // // SetValue // int // Trend // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:17:00.8573374 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 2 // // 2020-04-30T22:17:00.8573374 // false // // SetValue // int // Trend // // All // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:27:45.57583 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // GreaterEqual // // // false // true // TimeOpen // Arithmetic // // TimeOpen.TimeOfDay // // // 0 // Currency // 2019-10-27T17:44:20.2515116 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay >= TimeOpen.TimeOfDay // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:28:43.6463056 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // LessEqual // // // false // true // Timeclose // Arithmetic // // Timeclose.TimeOfDay // // // 0 // Currency // 2019-10-27T17:45:43.8532844 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay <= Timeclose.TimeOfDay // // // Any // // // // // false // true // DaysOk // Arithmetic // // DaysOk // // // 0 // Currency // 2019-10-24T21:34:49.4666987 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // 1 // Equals // // // false // true // True // Arithmetic // // true // // // 0 // Currency // 2019-10-24T21:34:49.4746926 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // // // false // DaysOk = true // // // Any // // // // // true // true // Close // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-04-30T21:44:08.0700822 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // 1 // Greater // // // true // true // EMASlopeColor // Arithmetic // // EMASlopeColor // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-04-30T21:44:50.1491985 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // UpColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 50 // 205 // 50 // 1 // 0.0318960324 // 0.610495567 // 0.0318960324 // // // // // // // DnColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 255 // 0 // 0 // 1 // 1 // 0 // 0 // // // // // // // ColorSlope // // // true // // // // // EMASlopeColor // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFFFA500</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA_Slope_Color // Line // // // // false // false // true // Close // Indicator // EMA_Slope_Color // // 0 // Currency // 2020-04-30T21:44:08.0940666 // Sunday // 0 // false // 0 // Long // // // false // 0 // Add // Arithmetic // // // 0 // false // // // false // true // Umbralup // Arithmetic // // Umbralup // // // 0 // Currency // 2020-04-30T21:46:33.3326486 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // Umbralup // // // 0 // Series // 0 // Undefined // // // // // false // Default input[0] > (EMASlopeColor(Ema20, Brushes.LimeGreen, Brushes.Red, true)[0] + (Umbralup)) // // // Any // // // // // true // true // Trend // Arithmetic // // Trend // // // 0 // Currency // 2020-04-30T22:07:03.9614788 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // 1 // Equals // // // true // true // Numeric value // Arithmetic // // {0} // // NumericValue // // // 0 // Currency // 2020-04-30T22:07:03.9834638 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // // // false // Trend = 0 // // // Set 6 // 6 // // // // // // false // true // Enter short position // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // true // QuantityStocks // Arithmetic // // QuantityStocks // // // 0 // Currency // 2019-10-30T21:26:07.2673022 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // QuantityStocks // // // // // // // // 0 // sell // // // // // // // // // 0 // Set Enter short position // // // // BottomLeft // 2019-10-30T21:25:56.1800133 // false // // Enter // // EnterShort // // quantity // signalName // // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-04-30T22:16:21.4793875 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // // 0 // true // true // 1 // // 2020-04-30T22:16:21.4793875 // false // // SetValue // int // Trend // // // All // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:27:45.57583 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // GreaterEqual // // // false // true // TimeOpen // Arithmetic // // TimeOpen.TimeOfDay // // // 0 // Currency // 2019-10-27T17:44:34.898231 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay >= TimeOpen.TimeOfDay // // // Any // // // // // true // true // Time series // Arithmetic // // Times[{0}][{1}].TimeOfDay // // Series1 // BarsAgo // // // 0 // Currency // 2019-10-24T21:28:43.6463056 // Sunday // 0 // true // 0 // Long // 0 // Time // 0 // Undefined // // // 1 // LessEqual // // // false // true // Timeclose // Arithmetic // // Timeclose.TimeOfDay // // // 0 // Currency // 2019-10-27T17:46:04.2758117 // Sunday // 0 // false // 0 // Long // 0 // Time // 0 // Undefined // // // // // false // Times[Default input][0].TimeOfDay <= Timeclose.TimeOfDay // // // Any // // // // // false // true // DaysOk // Arithmetic // // DaysOk // // // 0 // Currency // 2019-10-24T21:35:28.5013276 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // 1 // Equals // // // false // true // True // Arithmetic // // true // // // 0 // Currency // 2019-10-24T21:35:28.50932 // Sunday // 0 // false // 0 // Long // 0 // Bool // 0 // Undefined // // // // // false // DaysOk = true // // // Any // // // // // true // true // Close // Arithmetic // // {0} // // Series1 // BarsAgo // OffsetBuilder // // // 0 // Currency // 2020-04-30T21:44:08.0700822 // Sunday // 0 // false // 0 // Long // 0 // Series // 0 // Undefined // // // 1 // Less // // // true // true // EMASlopeColor // Arithmetic // // EMASlopeColor // // AssociatedIndicator // BarsAgo // OffsetBuilder // // // // Indicator DataSeries CustomSeries DefaultSeries // // // // Period // // // // Ema20 // 0 // true // // // false // true // Ema20 // Arithmetic // // Ema20 // // // 0 // Currency // 2020-04-30T21:44:50.1491985 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // // // // // // UpColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 50 // 205 // 50 // 1 // 0.0318960324 // 0.610495567 // 0.0318960324 // // // // // // // DnColor // // // // 1 // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // // 1 // 0 // 0 // 1 // 0 // 0 // // // // 255 // 255 // 0 // 0 // 1 // 1 // 0 // 0 // // // // // // // ColorSlope // // // true // // // // // EMASlopeColor // // // false // <SolidColorBrush xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">#FFFFA500</SolidColorBrush> // Solid // 100 // 1 // false // 1.7976931348623157E+308 // -1.7976931348623157E+308 // EMA_Slope_Color // Line // // // // false // false // false // Close // Indicator // EMA_Slope_Color // // 0 // Currency // 2020-04-30T21:44:08.0940666 // Sunday // 0 // false // 0 // Long // // // false // 0 // Subtract // Arithmetic // // // 0 // false // // // false // true // UmbralDown // Arithmetic // // UmbralDown // // // 0 // Currency // 2020-04-30T21:45:43.6921138 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // UmbralDown // // // 0 // Series // 0 // Undefined // // // // // false // Default input[0] < (EMASlopeColor(Ema20, Brushes.LimeGreen, Brushes.Red, true)[0] - (UmbralDown)) // // // Any // // // // // true // true // Trend // Arithmetic // // Trend // // // 0 // Currency // 2020-04-30T22:07:21.1659007 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // 1 // Equals // // // true // true // Numeric value // Arithmetic // // {0} // // NumericValue // // // 0 // Currency // 2020-04-30T22:07:21.1898845 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // // // false // Trend = 0 // // // Set 7 // 7 // // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-05-01T15:34:51.1655228 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // 2020-05-01T15:34:51.1655228 // false // // SetValue // int // Trend // // // // false // true // Set Trend // Arithmetic // // Solid // false // // // false // false // false // Information // Currency // Currency // Medium // // 0 // true // // false // false // Default order quantity // Arithmetic // // DefaultQuantity // // // 0 // Currency // 2020-05-01T15:34:51.1655228 // Sunday // 0 // false // 0 // Long // 0 // Number // 0 // Undefined // // // false // DefaultQuantity // // // // // BottomLeft // 2020-05-01T15:34:51.1655228 // false // // SetValue // int // Trend // // All // // // Any // // // // false // true // Current market position // Arithmetic // // Position.MarketPosition // // // 0 // Currency // 2020-05-01T15:34:30.2028416 // Sunday // 0 // false // 0 // Long // 0 // MarketData // 0 // Undefined // // // 1 // Equals // // false // true // Market position // Arithmetic // // MarketPosition.{0} // // MarketPosition // // // 0 // Currency // 2020-05-01T15:34:30.230826 // Sunday // 0 // false // 0 // Flat // 0 // MarketData // 0 // Undefined // // // // // false // Position.MarketPosition = MarketPosition.Flat // // // Set 8 // 8 // // // // // Enter the description for your new custom Strategy here. // true // true // true // true // 1 // AllEntries // true // 30 // false // // // 0,02 // // Profit // 0,001 // double // // // 0,01 // // Loss // 0,001 // double // // // 100 // // QuantityStocks // 1 // double // // // 09:30 // // TimeOpen // // time // // // 17:00 // // Timeclose // // time // // // 20 // // Ema20 // 1 // int // // // 2 // // Umbralup // 0 // double // // // 2 // // UmbralDown // 0 // double // // // true // true // Infinite // 20 // Standard // 1 // Minute // false // true // // StopCancelClose // Right // Strategy // 0 // WaitUntilFlat // // PerEntryExecution // Gtc // false // false // false // false // true // false // true // false // false // true // true // true // false // false // false // true // true // true // false // false // true // false // true // false // false // // // true // DaysOk // bool // // // 0 // Trend // int // // // ema // //@*/ //#endregion