DiscontinuousLine and Points

Created at 13 Nov 2013, 17:36
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!
jeex's avatar

jeex

Joined 18.10.2013

DiscontinuousLine and Points
13 Nov 2013, 17:36


My indicator draws a DiscontinuousLine. Each lines ends in a Point, marking to trade, or not to trade, because that is the question.

Now my robot should act on that line, but the question is: what is de value of a DiscontinuousLine or Point if there is none drawn by the indicator for that specific bar or tick?


@jeex
Replies

jeex
14 Nov 2013, 10:55

Addition

In addition to the question: is there a way to establish if a DiscontinuousLine or Point is drawn or not?


@jeex

Hyperloop
14 Nov 2013, 22:44

/forum/cbot-support/1895

This is probably what you're looking for


@Hyperloop

jeex
15 Nov 2013, 12:48

Bad luck

Thanks but the DiscontinuousLine is not without value, when it is not visible. So IsNaN won't do the trick.

This way a DiscontinuousLine is useless for robots. If the value is random but not NaN you can't use the values in a robot.


@jeex

jeex
15 Nov 2013, 13:12

Correction

Testing proved me wrong. the value is NaN if not drawn, but somehow, it remains NaN if a line is drawn afterwards, like in this example
 

public override void Calculate(int index)
{ 
   ....
   stepsback = index - 4;
   for (int x = stepsback; x <= index; x++)
   {   
     drawDisLine(x, value_Y);
   }
}

 

Here the value when tested remains NaN for the first 4 steps, only the step with x=index has a numeric value, while the line is actually visible for all 5 steps.

So drawing a line afterwards, gives an ambiguous result: visible but not valid.


@jeex