Thanks for the reply. I have been trying to figure this out, but with the Duka API page not giving any examples, it makes breaking into jfx tough. I have pasted the code I use in MT4 to close my orders. If it is not too much to ask, would you mind translating it into jfx? I am not sure if it will make a difference, but I am an External Manager with you guys, so if I can figure this out, it would be good for all of us. Also, once I have the basic template together, I would be happy to post it here to help anyone else who might need complete system code examples.
The value "ma" (found in the pasted code below) is a moving average, for which I already know how to write the code.
Thanks in advance for your time.
Matt
if(OrderType()==OP_BUY)
{
if ((iOpen(Symbol(),PERIOD_M1,1)>ma && iClose(Symbol(),PERIOD_M1,1)<ma && Close[1]-OrderOpenPrice()>=200*Point) ||
(iClose(Symbol(),60,1)<ma1) || (Hour()==22 && DayOfWeek()==5))
{
RefreshRates();
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_BID),1,Violet);
}
}
if(OrderType()==OP_SELL)
{
if ((iOpen(Symbol(),PERIOD_M1,1)<ma && iClose(Symbol(),PERIOD_M1,1)>ma && OrderOpenPrice()-Close[1]>=200*Point)||
(iClose(Symbol(),60,1)>ma1) || (Hour()==22 && DayOfWeek()==5))
{
RefreshRates();
OrderClose(OrderTicket(),OrderLots(),MarketInfo(OrderSymbol(),MODE_ASK),1,Violet);
}
}
}