bullish&bearish candle

Created at 11 Jun 2018, 21:52
How’s your experience with the cTrader Platform?
Your feedback is crucial to cTrader's development. Please take a few seconds to share your opinion and help us improve your trading experience. Thanks!
HA

hamidrtafx@gmail.com

Joined 18.02.2018

bullish&bearish candle
11 Jun 2018, 21:52


:hi i need code forexample pics

 

 

.for bullish&bearish  candle

 

:my code is

using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;

namespace cAlgo
{

    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]
    public class InsideBarPatternRecognition : Indicator
    {
        [Output("Up Point", Color = Colors.Orange, PlotType = PlotType.Points, Thickness = 5)]
        public IndicatorDataSeries UpPoint { get; set; }
        [Output("Down Point", Color = Colors.Orange, PlotType = PlotType.Points, Thickness = 5)]
        public IndicatorDataSeries DownPoint { get; set; }

        public override void Calculate(int index)
        {
            var motherCandleHigh = MarketSeries.High.Last(1);
            var motherCandleLow = MarketSeries.Low.Last(1);
            var motherCandleOpen = MarketSeries.Open.Last(1);
            var motherCandleClose = MarketSeries.Close.Last(1);

            var childCandleHigh = MarketSeries.High.Last(2);
            var childCandleLow = MarketSeries.Low.Last(2);
            var childCandleOpen = MarketSeries.Open.Last(2);
            var childCandleClose = MarketSeries.Close.Last(2);

            if (motherCandleHigh < childCandleHigh && motherCandleLow < childCandleLow && motherCandleOpen <= childCandleClose && motherCandleClose <= childCandleOpen && motherCandleLow <= childCandleClose && motherCandleLow <= childCandleOpen && motherCandleHigh <= childCandleClose && motherCandleHigh <= childCandleOpen && Math.Abs(motherCandleOpen - motherCandleClose) > Math.Abs(childCandleOpen - childCandleClose))
                DrawPoint(index);

        }
// Draws a point next to the parent bar
        private void DrawPoint(int index)
        {
            UpPoint[index - 2] = MarketSeries.High[index - 2] + 0.0005;
            DownPoint[index - 2] = MarketSeries.Low[index - 2] - 0.0005;
        }
    }
}

can you help me?


@hamidrtafx@gmail.com
Replies

PanagiotisCharalampous
12 Jun 2018, 09:50

Hi hamidrtafx@gmail.com,

It is not clear what you need the code to do. Please give us more information in order to help you.

Best Regards,

Panagiotis


@PanagiotisCharalampous

hamidrtafx@gmail.com
12 Jun 2018, 14:03

RE:

Panagiotis Charalampous said:

Hi hamidrtafx@gmail.com,

It is not clear what you need the code to do. Please give us more information in order to help you.

Best Regards,

Panagiotis

105/5000

I need to read the code that one candel in the body of the previousl candel , as shown in the above pictures .


@hamidrtafx@gmail.com

PanagiotisCharalampous
12 Jun 2018, 14:28

Hi hamidrtafx@gmail.com,

Try the below

            if ((MarketSeries.Open.Last(2) < MarketSeries.Close.Last(1) && MarketSeries.Close.Last(2) > MarketSeries.Close.Last(1)) || (MarketSeries.Open.Last(2) > MarketSeries.Close.Last(1) && MarketSeries.Close.Last(2) < MarketSeries.Close.Last(1)))
            {
                // Do something
            }

Best Regards,

Panagiotis


@PanagiotisCharalampous

hamidrtafx@gmail.com
12 Jun 2018, 20:36

RE:

Panagiotis Charalampous said:

Hi hamidrtafx@gmail.com,

Try the below

            if ((MarketSeries.Open.Last(2) < MarketSeries.Close.Last(1) && MarketSeries.Close.Last(2) > MarketSeries.Close.Last(1)) || (MarketSeries.Open.Last(2) > MarketSeries.Close.Last(1) && MarketSeries.Close.Last(2) < MarketSeries.Close.Last(1)))
            {
                // Do something
            }

Best Regards,

Panagiotis

thanks but not true

i want 

high.low.close.open) last 1 candel in the body last 2 )
 

for example picture


@hamidrtafx@gmail.com