Hi guys,
I was wondering on how to use the cross of the fastDPeriod and fastKPeriod to initialize a trade...so far I have:
if (stochrsi[fastKPeriod] > stochrsi[fastDPeriod]) {
order = engine.submitOrder(getLabel(instrument), instrument, OrderCommand.BUY, lots, 0, 5,
lowPrice, tick.getAsk() + instrument.getPipValue() * takeProfit);
}
and stochrsi is defined as:
stochrsi = indicators.stochRsi(instrument, myPeriod, OfferSide.BID, AppliedPrice.MEDIAN_PRICE, 3, fastKPeriod, fastDPeriod, IIndicators.MaType.SMA, 0)
additionally, fastKPeriod is defined:
private int fastKPeriod = 10;
and fastDPeriod is defined:
private int fastDPeriod = 12;
Unfortunately, although the compiler shows no errors, no orders are submitted or filled.
Any suggestions?