Zaczalem pisac ea w javie pod jforex i mam problem z prostym warunkiem. Chodzi o to aby order byl wysylany w momencie gdy cena jest wieksza/mniejsza o x pips od high/low poprzedniiej swiecy. Wie ktos jak to napisac?
Probuje w ten sposob:
Kod: Zaznacz cały
IBar bar = history.getBar(instrument, Period.ONE_MIN, OfferSide.BID, 1);
double High = bar.getHigh();
double Low= bar.getLow();
if (positionsTotal(instrument) == 0)
{
if (bidPrice< Low ) {
sell(instrument, engine, profitLimit, lossLimit, volume);
}
else if (bidPrice> High) {
buy(instrument, engine, profitLimit, lossLimit, volume);
}
}

pozdr.