Profile Picture

Different Result in Code and D&D

Posted By ywlee 4 Years Ago
Message
Posted Thursday November 07 2013
Hi

If I compare EMA(50) against the EMA(200) in code and in D&D, I get different results under "Scan". The code generates a "buy" signal whereas the D&D does not. Based on the graph, the D&D is correct. I must have missed some configuration setting for the code (which is quite simple) but cant seem to work it out as the examples use (almost) the same syntax.

Would appreciate any help. Thanks!

Anyway, the relevant parts of the code is as follows:

Private ema50 As New EMA(50)
Private ema200 As New EMA(200)

Public Overloads Overrides Sub Startup()
ema50.SetInputs(Close)
ema200.SetInputs(Close)


Public Overloads Overrides Sub NewBar()
If ema50.Current > ema200.Current Then
OpenPosition(PositionType.Long, OrderType.MarketOnOpen)

EndIf





phg
Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)Supreme Being (44,679 reputation)
Posted Thursday November 07 2013
Note that
If ema50.Current > ema200.Current Then
is likely true for many bars, one after the other, while a crossover is true only once.

-Pete

See also Yahoo group about applying RE.

Posted Sunday November 10 2013
If you want to check for a crossover from code, use SystemUtils.CrossOver(ema50, ema200).

Thanks,
Daniel


Similar Topics


Reading This Topic


2005-2017 © RightEdge Systems