Ichimoku Span A and Span B of future bars

Created at 13 Nov 2018, 21:41
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!
solomonawulonu's avatar

solomonawulonu

Joined 10.06.2018

Ichimoku Span A and Span B of future bars
13 Nov 2018, 21:41


Dear support,

 

I tried getting the value of future bars of ichimoku.SpanA and Ichimoku.SpanB but it is returning NAN.

In Metatrader, one can use negative index such as -1 to get the value of Ichimoku Span A and Span B for future bars.

Is there any solution available for CTrader/CAlgo.

Best Regards


@solomonawulonu
Replies

PanagiotisCharalampous
14 Nov 2018, 10:12

Hi Solomon,

Can you share with us a small sample code that is returning NaN values so tha we can advise further?

Best Regards,

Panagiotis


@PanagiotisCharalampous

solomonawulonu
14 Nov 2018, 11:11

IchimokuKinkoHyo Ichimoku = Indicators.IchimokuKinkoHyo(MarketSeriesHR1, 9, 26, 52);

int tomorrow = Time.Hour - 25;

double ichimoku_span_a = Ichimoku.SenkouSpanA.Last(tomorrow);
double ichimoku_span_b = Ichimoku.SenkouSpanB.Last(tomorrow);

Print("A: " + ichimoku_span_a + " B: " + ichimoku_span_b);

The result shows NaN for both Span A and B.

I am trying to know the values of span a and b for the next day open.

 


@solomonawulonu

PanagiotisCharalampous
14 Nov 2018, 11:59

Hi Solomon,

See below how to get the values for 10 bars ahead

           Ichimoku = Indicators.IchimokuKinkoHyo(MarketSeries, 9, 26, 52);
           Print("A: " + Ichimoku.SenkouSpanA.Last(Ichimoku.SenkouSpanA.Count - MarketSeries.Close.Count - 10)  + " B: " + Ichimoku.SenkouSpanB.Last(Ichimoku.SenkouSpanA.Count - MarketSeries.Close.Count - 10));
       

Best Regards,

Panagiotis


@PanagiotisCharalampous