Issue with Fractal Indicator

Created at 01 Aug 2023, 12:34
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!
CA

callum.umpleby

Joined 28.07.2023

Issue with Fractal Indicator
01 Aug 2023, 12:34


Hello,

I am trying to use the fractals indicator and place an order on an down or up fractal

I am trying to achieve this by the following line of code as an example of the condition I want to enter a long trade at.

double.IsNaN(fractal.DownFractal.Last(1)) == false

However the line above always returns NaN and never the last value, even tho I can see in the list of values it has a price value as the last value.

Please can someone advice on how to use this indicator or what I am doing wrong?


@callum.umpleby
Replies

firemyst
02 Aug 2023, 12:05

Your code is saying get the fractal value from the last bar, not the actual last fractal value.

 

If that's not the case, then you need to post more of your code so people can see what's going on.


@firemyst

callum.umpleby
02 Aug 2023, 13:03

RE: Issue with Fractal Indicator

firemyst said: 

Your code is saying get the fractal value from the last bar, not the actual last fractal value.

 

If that's not the case, then you need to post more of your code so people can see what's going on.

Yes that is correct I am trying to get the value from the last bar, and if it is NaN then i would not expect a up or down fractal value and no signal on the chart, and if it returned a value I would expect a signal to show on the chart, and at this stage I would then enter a position.

However it always returns the last value, even when there are no signals being sent where I would expect a Nan to be returned, it adds 20 items to the either Down or Up Fractal list.

The first 19 items are Nan and the final one is the last up or down fractal value. Which seems to be a bug as I would expect only one item added for each bar position, 

If you have a working example of this indicator trading on either a up or down fractal signal I would appreciate it. 


@callum.umpleby