Does CrossUnder work for gaps?
Author: grtrader
Creation Date: 3/4/2014 1:37 PM
profile picture

grtrader

#1
I have a program which sells if the close crosses below a moving average. Works fine - until I had a gap of the close from above the moving average to below the moving average. No Sell signal was generated.
profile picture

Cone

#2
CrossUnder/Over will always work when applying the overload for (int bar, DataSeries ds1, DataSeries ds2).

If you apply the price level value overload, i.e., (int bar, DataSeries ds1, double value), it can fail where you might expect it to work.

It's hard to explain without a picture, but suffice to say that the latter overload should not be used if value is expected to change. It must be a constant level to guarantee the crossing condition. We recently entered a deficiency for the following Strategy Builder rules precisely for this reason. The rule should apply the first overload but does not.

a. Price crosses above Price from previous day
b. Price crosses below Price from previous day
profile picture

grtrader

#3
Thanks - its good to know others have the same experience.
This website uses cookies to improve your experience. We'll assume you're ok with that, but you can opt-out if you wish (Read more).