Example #1
0
 protected override void Init()
 {
     _psInd          = GetIndicator <ParabolicSar>(Instrument.Id, Timeframe);
     _psInd.CoefStep = 0.01;
     dlt             = dl * Instrument.Point; // Отступ от стопа
     _frInd          = GetIndicator <Fractals>(Instrument.Id, Timeframe);
 }
Example #2
0
        public DateTime DTime;         // Время

        protected override void Init()
        {
            InitLogFile();
            #region GetIndicatorsAndFrames// Get Indicators' references...
            // Event occurs once at the start of the strategy
            //XXPrint("Starting TS on account: {0}, comment: {1}, buystop : {2} sellstop : {3}",
            //	this.Account.Number, "CommentText", listOfBuyStop.Count, listOfSellStop.Count);
            Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);



            _ma1 = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, 85, 0, MethodMA1, ApplyMA1To);
            _ma2 = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, 75, 0, MethodMA1, ApplyMA1To);
            _ma3 = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, 5, 0, MethodMA2, ApplyMA2To);

            _macd = GetIndicator <MovingAverageConvergenceDivergence> (Instrument.Id, Timeframe);
            _macd.FastEmaPeriod = 15;
            _macd.AppliedPrice  = ApplyMA2To;
            _macd.SlowEmaPeriod = 26;
            _macd.SmaPeriod     = 1;
            _awoInd             = GetIndicator <AwesomeOscillator>(Instrument.Id, Timeframe);
            _ftoInd             = GetIndicator <FisherTransformOscillator>(Instrument.Id, Timeframe);
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);


            #endregion //GetIndicatorsAndFrames
        }
Example #3
0
 protected override void Init()
 {
     _frInd  = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _ftoInd = GetIndicator <FisherTransformOscillator>(Instrument.Id, Timeframe);
     Ur1     = 10.0;
     Ur2     = 0.0;
 }
Example #4
0
        protected override void Init()
        {
            // Event occurs once at the start of the strategy
            Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);
            InitLogFile();
            XXPrint("ZZ11:{0} Счет:{1} Пара:{2}", Bars[Bars.Range.To].Time, this.Account.Number, this.Instrument.Name);
            XXPrint("Ордер Дата Time №Ордер Цена Left Right Delta VLeft VOrder VRight");

            _wprInd          = GetIndicator <ZigZag>(Instrument.Id, Timeframe);
            _wprInd.ExtDepth = ED;

            if (Instrument.Name.EndsWith("JPY"))
            {
                kor2 = 0.001 * Pt; Zn = 1000; n = 3;
            }
            else
            {
                kor2 = 0.00001 * Pt; Zn = 100000; n = 5;
            }
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);

            vr = Tools.Create <VerticalLine>(); vr.Color = Color.Red;
            vb = Tools.Create <VerticalLine>(); vb.Color = Color.Blue;
            vy = Tools.Create <VerticalLine>(); vy.Color = Color.Yellow;
            vw = Tools.Create <VerticalLine>(); vw.Color = Color.White;
        }
Example #5
0
 protected override void Init()
 {   // Вставить индикатор Alligator
     _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
     // Вставить индикатор Fractals
     _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _frInd.Range = fRan;
 }
Example #6
0
        // Fractal


        protected override void Init()
        {
            // Event occurs once at the start of the strategy
            Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);
            _wprInd          = GetIndicator <ZigZag>(Instrument.Id, Timeframe);
            _wprInd.ExtDepth = ED;
            if (Instrument.Name.EndsWith("JPY"))
            {
                kor = 0.001 * SP;
            }
            else
            {
                kor = 0.00001 * SP;
            }
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);


            vr = Tools.Create <VerticalLine>(); vr.Color = Color.Red;
            vb = Tools.Create <VerticalLine>(); vb.Color = Color.Blue;
            vy = Tools.Create <VerticalLine>(); vy.Color = Color.Yellow;
            vw = Tools.Create <VerticalLine>(); vw.Color = Color.White;

            if (Instrument.Name.EndsWith("JPY"))
            {
                x = 0.3;
            }
            else
            {
                x = 0.003;
            }
        }
Example #7
0
        // private ZigZag _wprInd;

        protected override void Init()
        {
//			_wprInd= GetIndicator<ZigZag>(Instrument.Id, Timeframe);
//			_wprInd.ExtDepth=ED;
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
//			_ftoInd = GetIndicator<FisherTransformOscillator>(Instrument.Id, Timeframe);
        }
Example #8
0
        protected override void Init()
        {
            nu = false; nd = false; tu = false; td = false;
            Print("Init !!! 1");
            InitFile();
            _ma50        = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, 50, 0, MaMethods.Ema, PriceMode.Close);
            _tsfInd      = GetIndicator <TimeSeriesForecast>(Instrument.Id, Timeframe);
            _ftoInd      = GetIndicator <FisherTransformOscillator>(Instrument.Id, Timeframe);
            _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
            _frInd.Range = frac - 2;

            vl       = Tools.Create <VerticalLine>();
            vl.Width = 2;
            hl       = Tools.Create <HorizontalLine>();

            k   = 0;                     // Для першого входження -
            kf  = 0.090909;
            dlt = dl * Instrument.Point; // Отступ от стопа

            frU1 = 0.0; frU2 = 0.0; frU3 = 0.0;
            frD1 = 0.0; frD2 = 0.0; frD3 = 0.0;
            fsU1 = 0.0; fsU2 = 0.0; fsU3 = 0.0;
            fsD1 = 0.0; fsU2 = 0.0; fsU3 = 0.0;

            trueLogPath = PathToLogFile + "\\" + L1 + "_" + Instrument.Name.ToString() + ".LOG";
            trueBuyPath = PathToLogFile + "\\01_TORG.LOG";
        }
Example #9
0
        private void AddFractal(int currentIndex)
        {
            int size = 20;

            var qqq = Fractals.Calculate(candlesList, currentIndex);

            if (qqq.Item1)
            {
                CustomAnnotation annotation = null;

                if (qqq.Item2 == Fractals.Type.Top)
                {
                    var         uri = new Uri(AppDomain.CurrentDomain.BaseDirectory + "up.png", UriKind.RelativeOrAbsolute);
                    BitmapImage bi  = new BitmapImage();
                    bi.BeginInit();
                    bi.UriSource = uri;
                    bi.EndInit();

                    Image arrow = new Image()
                    {
                        Source = bi,
                        Width  = size,
                        Height = size
                    };
                    annotation = new CustomAnnotation()
                    {
                        X1                    = currentIndex,
                        Y1                    = candlesList[currentIndex].High,
                        Content               = arrow,
                        ContentTemplate       = (DataTemplate)sciChart.Resources["AnnotationTemplate"],
                        VerticalAnchorPoint   = VerticalAnchorPoint.Bottom,
                        HorizontalAnchorPoint = HorizontalAnchorPoint.Center
                    };
                }
                else if (qqq.Item2 == Fractals.Type.Bottom)
                {
                    var         uri = new Uri(AppDomain.CurrentDomain.BaseDirectory + "down.png", UriKind.RelativeOrAbsolute);
                    BitmapImage bi  = new BitmapImage();
                    bi.BeginInit();
                    bi.UriSource = uri;
                    bi.EndInit();
                    Image arrow = new Image()
                    {
                        Source = bi,
                        Width  = size,
                        Height = size
                    };
                    annotation = new CustomAnnotation()
                    {
                        X1                    = currentIndex,
                        Y1                    = candlesList[currentIndex].Low,
                        Content               = arrow,
                        ContentTemplate       = (DataTemplate)sciChart.Resources["AnnotationTemplate"],
                        VerticalAnchorPoint   = VerticalAnchorPoint.Top,
                        HorizontalAnchorPoint = HorizontalAnchorPoint.Center
                    };
                }
                sciChart.Annotations.Add(annotation);
            }
        }
Example #10
0
 public IEnumerable <Token> GetAllTokens()
 {
     return(GeneralTokens
            .Concat(Fractals.Where(fractal => fractal != null).Select(fractal => fractal))
            .Concat(GetAllEvents().Where(encounter => encounter.Token != null)
                    .Select(encounter => encounter.Token)));
 }
Example #11
0
 protected override void Init()
 {
     // Event occurs once at the start of the strategy
     Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);
     _awoInd = GetIndicator <AwesomeOscillator>(Instrument.Id, Timeframe);
     _frInd  = GetIndicator <Fractals>(Instrument.Id, Timeframe);
 }
        protected override void Init()
        {
            // Event occurs once at the start of the strategy
            // Вставить индикатор Alligator
            _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
            // Вставить индикатор Fractals
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);

            hline     = Tools.Create <HorizontalLine>();
            lline     = Tools.Create <HorizontalLine>();
            vlR       = Tools.Create <VerticalLine>();
            vlR.Color = Color.Red;
            vlB       = Tools.Create <VerticalLine>();
            vlB.Color = Color.Blue;
            vlY       = Tools.Create <VerticalLine>();
            vlY.Color = Color.Yellow;
            vlG       = Tools.Create <VerticalLine>();
            vlG.Color = Color.DarkGreen;

            //periodM15 = new Period(PeriodType.Minute, 15);
            //_barSeries = GetCustomSeries(Instrument.Id, Period.H1);
            //_barM15 = GetCustomSeries(Instrument.Id,periodM15);
            //_ftoInd   = GetIndicator<FisherTransformOscillator>(Instrument.Id, Period.H1);
            //_ftoIndM15= GetIndicator<FisherTransformOscillator>(Instrument.Id, periodM15);
        }
Example #13
0
 protected override void Init()
 {
     _awoInd          = GetIndicator <AwesomeOscillator>(Instrument.Id, Timeframe);
     _frInd           = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _frInd.Range     = 7;
     _wprInd          = GetIndicator <ZigZag>(Instrument.Id, Timeframe);
     _wprInd.ExtDepth = ED;
 }
Example #14
0
 protected override void Init()
 {
     Print("{0} Start INIT ", Bars[Bars.Range.To - 1].Time);
     InitLogFile();
     dlt     = dl * Instrument.Point;
     _ftoInd = GetIndicator <FisherTransformOscillator>(Instrument.Id, Timeframe);
     _frInd  = GetIndicator <Fractals>(Instrument.Id, Timeframe);
 }
Example #15
0
        protected override void Init()
        {
            _wprInd          = GetIndicator <ZigZag>(Instrument.Id, Timeframe);
            _wprInd.ExtDepth = 30;

            _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
            _frInd.Range = 5;
        }
Example #16
0
 protected override void Init()
 {
     // Event occurs once at the start of the strategy
     _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
     _frInd  = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _awoInd = GetIndicator <AwesomeOscillator>(Instrument.Id, Timeframe);
     //_aoInd =  GetIndicator<AcceleratorOscillator>(Instrument.Id, Timeframe);
 }
Example #17
0
 protected override void Init()
 {
     _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     //nkz=Math.Round((double)nkz1/100000,5);
     vr = Tools.Create <VerticalLine>(); vr.Color = Color.Red;
     vb = Tools.Create <VerticalLine>(); vb.Color = Color.Blue;
     L1 = Tools.Create <HorizontalLine>();
 }
Example #18
0
 public MainPage()
 {
     InitializeComponent();
     bmp = new WriteableBitmap(2 * 640, 2 * 480);
     fractalImage.Source = bmp;
     Fractals.WriteMandelbrot(bmp);
     bmp.Invalidate();
 }
 protected override void Init()
 {
     // Event occurs once at the start of the strategy
     // Вставить индикатор Alligator
     _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
     // Вставить индикатор Fractals
     _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
 }
Example #20
0
        protected override void Init()
        {
            _wprInd          = GetIndicator <ZigZag>(Instrument.Id, Timeframe);
            _wprInd.ExtDepth = ED;
            _frInd           = GetIndicator <Fractals>(Instrument.Id, Timeframe);

            torg = false;
        }
Example #21
0
 protected override void Init()
 {
     k                = 0; NKZ = 560;
     _frInd           = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     Print("Init"); k = 0;
     frU1             = 0; frU2 = 0; frU3 = 0; frD1 = 0; frD2 = 0; frD3 = 0;
     // InitFr();
 }
Example #22
0
        protected override void Init()
        {
            dlt = dl * Instrument.Point; // Отступ от стопа
            InitLogFile();               // Запись логов

            _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
            _frInd.Range = frac - 2;
        }
Example #23
0
 public Form1()
 {
     InitializeComponent();
     bmp         = new Bitmap(pictureBox1.Width, pictureBox1.Height);
     g           = Graphics.FromImage(bmp);
     fractals    = new Fractals(g, Color.Black);
     back_ground = Color.White;
     front       = Color.Black;
 }
Example #24
0
 protected override void Init()
 {
     // Event occurs once at the start of the strategy
     Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);
     _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _frInd.Range = 9;
     //_frInd3 = GetIndicator<Fractals>(Instrument.Id, Timeframe);
     //_frInd3.Range = 3;
 }
Example #25
0
 protected override void Init()
 {
     /*	frU1 = fu1*Instrument.Point;
      *      frU2 = fu2*Instrument.Point;
      *      frD1 = fd1*Instrument.Point;
      *      frD2 = fd2*Instrument.Point;  */
     _frInd       = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _frInd.Range = frac - 2;
 }
        double fr_all_Down;           // Цена последней свечи с фракталом - полностью ниже Аллигатора

        protected override void Init()
        {
            // Event occurs once at the start of the strategy
            Print("Starting TS on account: {0}, comment: {1}", this.Account.Number, CommentText);
            // Вставить индикатор Alligator
            _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
            // Вставить индикатор Fractals
            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
        }
Example #27
0
        protected override void Init()
        {
            // Event occurs once at the start of the strategy
            // На график наносится скользящая средняя с периодом 20
            _ma20 = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, _maPeriod20, _maShift, _maMethod, _priceMode);
            // На график наносится скользящая средняя с периодом 50
            _ma50 = GetIndicator <MovingAverage>(Instrument.Id, Timeframe, _maPeriod50, _maShift, _maMethod, _priceMode);

            _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
        }
Example #28
0
 protected override void Init()
 {
     // Вставить индикатор Alligator
     _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
     // Вставить индикатор Fractals
     _frInd = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     // начальные значения для фракталов не касающиеся алигатора
     fr_all_Up   = Bars[Bars.Range.To - 1].High;
     fr_all_Down = Bars[Bars.Range.To - 1].Low;
 }
Example #29
0
    void Start()
    {
        rootSettings = this.GetComponent <Fractals>();

        if (isHL)
        {
            voiceManager = this.GetComponent <VoiceManager>();
            voiceManager.OnVoiceCommand += VoiceManager_OnVoiceCommand;
        }
    }
 protected override void Init()
 {
     // Event occurs once at the start of the strategy
     // Вставить индикатор Alligator
     _allInd = GetIndicator <Alligator>(Instrument.Id, Timeframe);
     // Вставить индикатор Fractals
     _frInd  = GetIndicator <Fractals>(Instrument.Id, Timeframe);
     _awoInd = GetIndicator <AwesomeOscillator>(Instrument.Id, Timeframe);
     //_aoInd =  GetIndicator<AcceleratorOscillator>(Instrument.Id, Timeframe);
     _ftoInd = GetIndicator <FisherTransformOscillator>(Instrument.Id, Timeframe);
 }