Category Trend  Published on 18/05/2021

OrglobalFx_Ichimoku_DoubleTF_v1.0

Description

Based on Ichimoku Timeframe H4 & D1

 

  • Indicator: Ichimoku Timeframe Analysis: D1 & H4 T
  • Platform: ctrader
  • Broker: ICMarkets https://www.icmarkets.com/?camp=41744
  • Strategy Details...
  • 1. Baseline and conversion line cross on D1
  • 2. Baseline and conversion line cross on H4
  • 3. Price cross conversion line on H4
  • 4. Price Kumo Breakout H4
  • 5. Kumo Status: Rising of Falling H4

You can enter trades using stop orders when indicators displays a 80% .
Note: This indicator does not give entry signals, It only displays trend bias.

 

  • For more details: Telergram: @orglobalng
  • Take trades at your risk.

 


// OrglobalFx_Ichimoku_DoubleTimeFrame_Indicator_v1_0
// Based on Ichimoku Timeframe H4 & D1
//



using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
using System.Collections.Generic;
using System.Net;

namespace cAlgo.Indicators
{
    [Indicator(IsOverlay = true, TimeZone = TimeZones.WCentralAfricaStandardTime, AccessRights = AccessRights.None)]
    public class OrglobalFx_Ichimoku_DoubleTimeFrame_Indicator_v1_0 : Indicator
    {
        public TimeFrame Time_frame1 = TimeFrame.Daily;
        public TimeFrame Time_frame2 = TimeFrame.Hour4;
        private Bars series1, series2;
        private IchimokuKinkoHyo cloud1, cloud2;
        public bool res1bull, res2bull, res3bull, res4bull, res5bull, res6bull, res7bull, res8bull;
        public bool res1bear, res2bear, res3bear, res4bear, res5bear, res6bear, res7bear, res8bear;

        protected override void Initialize()
        {
            series1 = MarketData.GetBars(Time_frame1);
            series2 = MarketData.GetBars(Time_frame2);
            cloud1 = Indicators.IchimokuKinkoHyo(series1, 9, 26, 52);
            cloud2 = Indicators.IchimokuKinkoHyo(series2, 9, 26, 52);
        }

        public override void Calculate(int index)
        {
            //Price and tensen on timeframe1
            res1bear = series1.ClosePrices.Last(1) < cloud1.TenkanSen.Last(0);
            res1bull = series1.ClosePrices.Last(1) > cloud1.TenkanSen.Last(0);

            //tensen and kijun on timeframe1
            res2bear = cloud1.TenkanSen.Last(0) < cloud1.KijunSen.Last(0);
            res2bull = cloud1.TenkanSen.Last(0) > cloud1.KijunSen.Last(0);

            //tenksen crossess kijun on timeframe2
            res3bear = cloud2.TenkanSen.Last(0) < cloud2.KijunSen.Last(0);
            res3bull = cloud2.TenkanSen.Last(0) > cloud2.KijunSen.Last(0);

            //Price and kumo on timeframe2
            var sekuA = cloud2.SenkouSpanA;
            var sekuB = cloud2.SenkouSpanB;
            var cloudupper = Math.Max(sekuA.Last(26), sekuB.Last(26));
            var cloudlower = Math.Min(sekuA.Last(26), sekuB.Last(26));
            res4bear = series2.ClosePrices.Last(1) < cloudlower;
            res4bull = series2.ClosePrices.Last(1) > cloudupper;

            //Price and Tensen
            res5bear = series2.ClosePrices.Last(0) < cloud2.TenkanSen.Last(0);
            res5bull = series2.ClosePrices.Last(0) > cloud2.TenkanSen.Last(0);

            //chiku and price
            res6bear = cloud2.ChikouSpan.Last(0) < series2.LowPrices.Last(26);
            res6bull = cloud2.ChikouSpan.Last(0) > series2.HighPrices.Last(26);

            //Kumo
            res7bear = (cloud2.SenkouSpanA.Last(0) < cloud2.SenkouSpanA.Last(1)) && (cloud2.SenkouSpanB.Last(0) < cloud2.SenkouSpanB.Last(1));
            res7bull = (cloud2.SenkouSpanA.Last(0) > cloud2.SenkouSpanA.Last(1)) && (cloud2.SenkouSpanB.Last(0) > cloud2.SenkouSpanB.Last(1));

            if (res1bull == true && res2bull == true && res3bull == true && res4bull == true && res5bull == true && res6bull == true && res7bull == true)
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.LimeGreen,
                    ForegroundColor = Color.Black,
                    Text = "100% BULLISH",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }

            else if (res1bear == true && res2bear == true && res3bear == true && res4bear == true && res5bear == true && res6bear == true && res7bear == true)
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.Red,
                    ForegroundColor = Color.Black,
                    Text = "100% BEARISH",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }

            else if (res1bull == true && res2bull == true && res3bull == true && res4bull == true && res5bull == true && res6bull == true && res7bull == false)
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.Green,
                    ForegroundColor = Color.Black,
                    Text = " 80% BULLISH ",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }

            else if (res1bear == true && res2bear == true && res3bear == true && res4bear == true && res5bear == true && res6bear == true && res7bear == false)
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.DarkRed,
                    ForegroundColor = Color.Black,
                    Text = " 80% BEARISH ",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }

            else if ((res1bull == true && res2bull == true) && (res3bull == false || res4bull == false || res5bull == false || res6bull == false || res7bull == false))
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.LightGreen,
                    ForegroundColor = Color.Black,
                    Text = " 50% BULLISH ",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }

            else if ((res1bear == true && res2bear == true) && (res3bear == false || res4bear == false || res5bear == false || res6bear == false || res7bear == false))
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.PaleVioletRed,
                    ForegroundColor = Color.Black,
                    Text = " 50% BEARISH ",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }
            else
            {
                var text = new TextBlock 
                {
                    FontSize = 18,
                    BackgroundColor = Color.Yellow,
                    ForegroundColor = Color.Black,
                    Text = "    NEUTRAL     ",
                    Padding = "12 8",
                    VerticalAlignment = VerticalAlignment.Top,
                    HorizontalAlignment = HorizontalAlignment.Left,
                    Margin = 5
                };
                Chart.AddControl(text);
            }
        }

    }
}


Orglobalfx01's avatar
Orglobalfx01

Joined on 03.03.2021

  • Distribution: Free
  • Language: C#
  • Trading platform: cTrader Automate
  • File name: OrglobalFx_Ichimoku_DoubleTimeFrame_Indicator_v1_0.algo
  • Rating: 0
  • Installs: 1467
Comments
Log in to add a comment.
No comments found.