Hello Support,
As I explained in a previous post, I'm learning to code with yours samples strategies in the API and with yours samples strategies (by Dukascopy) in the JSTORE.
So I'm sorry If I bring you some additional work on strategies you coded two or three years ago, but I need to understand why I find some bug on yours startegies: Is it the fact of the plateform or is there some errors in the code? It would help me and maybe some others in the community...
This week I was tested one of your simplest strategy called : MACDsignal.java
The signal is very simple:
*if the curent histogram is above zero line and was equal or below zero at the previous histogram, it closes a short order and opens a buy.
*if the curent histogram is below zero line and the previous histogram was above or equal zero line, it closes a long order and open a sell.
< if (macd0[HIST] > 0 && macd1[HIST] <= 0) {
closeOrder(order);
order = submitOrder(OrderCommand.BUY);
}
if (macd0[HIST] < 0 && macd1[HIST] >= 0) {
closeOrder(order);
order = submitOrder(OrderCommand.SELL); >According to this facts, if my SL= 300pips and my TP=300pips, the strat should open and close orders then open opposite order when histogram go above or below zero. So, after test in the historical tester and on demo (Time Frame 1 minute) it works as expected some times, and doesn't trade as expected a lot of other times! (see sample picture below: I add some arrows to show where it must close and sell or close and buy according to the code and the histogram). I test with filter all flat, filter WE and no filter without solution and the strategy is build without filter.
I paste the strategy but you can download it on the JSTORE.
Thanks a lot for your help and attention.
Cheers,
Math