Dukascopy Support Board

Rejected Trades/no trades for a long period
Page 1 of 1

Author:  vtechdir [ Tue 02 May, 2017, 09:36 ]
Post subject:  Rejected Trades/no trades for a long period

Dear Good people from support,

I have the attached strategy (continuare of https://www.dukascopy.com/swiss/english ... 41&t=55134) with all desired functionality. Also, I saved the HTML log file inside the Word document to be able to reproduce my test.

During testing it is obvious no trade has been taken during 1st March to 21st March (also 07-27 April) and it appears that when the log file prints:
2017-04-12 21:00:00 Commissions Commissions [0.0]

it is possible a trade rejection in the platform ? Could you please elucidate as to why there are so many rejections and also for such a long period?

Kind Regards

Rejected Trades.docx [17.98 KiB]
Downloaded 128 times
PetersSMMA_V1d.java [32.12 KiB]
Downloaded 157 times

Author:  amine_chourou [ Wed 03 May, 2017, 11:49 ]
Post subject:  Re: Rejected Trades/no trades for a long period

Hi there !

Well, I don't see the rejected trades you're referring to but I found that you're testing your strategy on EURUSD instrument where it is built in Visual JF on GBPUSD. you need to manually set the default instruemnt in JFOREX to GBPUSD :


I've also added the test report showing trades on cable for the period 01-03-2017 till 31-03-2017

I see in the messages that you're updating frequently your SL and TP orders with the same price. I've reduced this redundancy with couple of conditions as you see

InstrHT.JPG [81.32 KiB]
Downloaded 232 times
Rejected Trades_V2.docx [26.72 KiB]
Downloaded 117 times
PetersEMA_V3.jfx [34.26 KiB]
Downloaded 176 times

Author:  vtechdir [ Wed 03 May, 2017, 23:47 ]
Post subject:  Re: Rejected Trades/no trades for a long period

Hi Amine,

Thank you for your answer. Thank you for improving it's functionality. It raises some questions though:

1. If I develop the strategy on a defaultInstrument, when used in the Historical Tester, the platform will not replace it, that's why I have to edit the Java file?
2. In your report there are still no trades between 2017-03-01 21:00:00 and 2017-03-13 21:00:00 (and again another 10 days period) and it lists "Commission" in the event columns. Can you please explain why this is the case? Alternatively it makes one thinking that there are charged commissions when nothing happens? On the chart there will be missed adequate entry conditions by the strategy(not marked) during this period.
3. You attached the JFX file(binary), could you please include either the Java or the vjForex file?
4. You are using a different strategy than the one I attached in this case, however I believe the issue is pertinent regardless.

Kind Regards

Author:  amine_chourou [ Thu 04 May, 2017, 15:15 ]
Post subject:  Re: Rejected Trades/no trades for a long period

Hi there !

1/ It is slightly more complex: When using Visual Jforex having the default instrument set as per your need, the historical tester takes into account this and will start automatically using this instrument. If you export your strategy to JForex and run the historical tester, by default EURUSD is considered as default instrument and you need to edit that as per my previous screenshot.

2/ Just to clarify : The test made is as following:
- PetersEMA_V3 strategy report for GBP/USD instrument(s) from 2017-03-01 00:00:00 to 2017-03-31 00:00:00
- The commission charged (11.15)is related to the list of the 12 trades made on the test period.
- On the first of march I can see one short position : IVF20170301_06000993956422 0.001 SELL @ 1.23732 opened on 2017-03-01 06:00:10 closed on 2017-03-01 13:32:46
- The strategy did not trade between March 2nd and 13th because of conditions are simply not met.

3/ Sorry, I made a mistake. Attached is the Java version .. I've lost the vfs but I only implemented simple condition to avoid resubmitting the same SL and TP orders with the same price. The strategy trading logic remains the same;

4/ Which issue ? resubmitting the same SL and TP orders with the same price ?

HistTesterJforex.JPG [76.37 KiB]
Downloaded 201 times
PetersEMA_V3.java [35.83 KiB]
Downloaded 152 times

Author:  vtechdir [ Fri 05 May, 2017, 00:57 ]
Post subject:  Re: Rejected Trades/no trades for a long period

Hi Antoine,

Thank you very much for your efforts. I believe something got mixed up.

I edit the Java file with SMMA_Period=21 and EMA_Period=13 (since it is an EMA strategy, the smaller period makes the MA faster, so EMA will be faster). However when I run it and measure the indicators for the chart EMA(34) and SMMA(8).

What's even worse, is that the logic does not seem to work anymore, the trades come whenever not when crossing and even if I change the indicators on the chart for the start values, still the logic is not reflected.

Also the message: 23:34:43 Attempt to change stop loss of the order [IVF20170315_1552305005909] with the same price. Old price [1.21829], new price [1.21829]
is displayed several times.

Another thing is that the EventText= Commissions[x.y] does not match the number of orders taken previously, so I am not sure what it means.

I re-run the SMMA_V1d strategy and the MA still have the wrong values, it seems like they are cached somewhere in the program execution space. However it does not have the TSL and SL error messages (same value). The end of run report provides different values from the ones entered at start or the ones from the chart.

Kind Regards

Author:  amine_chourou [ Fri 05 May, 2017, 12:35 ]
Post subject:  Re: Rejected Trades/no trades for a long period


Attached is the vfs version that I tested. I've included some notes to clarify.
- As for the indicators periods: you have an assign block that sets back the periods to 13 in the beginning of the strategy
- I've inserted a new condition to avoid the redundancy of SL and TP orders
- testing the attached version in Jforex over last week, I have a commission of 4 cents for one trade which is correct. Latest report attached.

PetersEMA_V5.vfs [78.65 KiB]
Downloaded 144 times
Rejected Trades_V2.docx [32.46 KiB]
Downloaded 120 times

  Page 1 of 1