Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

Index and CFD trading with Visual JForex
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=146&t=54747
Page 1 of 1

Author:  Stroker [ Wed 01 Feb, 2017, 15:56 ]
Post subject:  Index and CFD trading with Visual JForex

Hello, is it possible to make a strategy with indexes? Example if stock indexes go down , sell USDJPY. I only can see currency pairs.

Thanks.

Author:  amine_chourou [ Thu 02 Feb, 2017, 11:36 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Hi,

Currently Visual Jforex doesn't support CFDs but there is a workaround to achieve your idea:
Simply build your strategy using USDJPY and another random currency, Do not use Default instrument but rather create new instrument variable and use it in your blocks. Once done, export the strategy to Jforex platform and in Historical tester switch the random instrument to JPN index then launch your test.
Currently we're experiencing an issue with Historical Tester both in VJF and JForex platforms but you can start developing your idea in VJF till we fix this issue so that you can test properly.

Author:  Stroker [ Thu 02 Feb, 2017, 12:26 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Ok, perfect. I can make the strategy with currency pairs and in the Strategy Editor change the currencies to the indexes.
The example is if in the New York session the SP500 and Dow Jones Drops, go short on USDJPY, with certain rules.

Thanks a lot.

Author:  amine_chourou [ Thu 02 Feb, 2017, 13:21 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Alright,

Can you start this idea in VJF and implement these rules ?
I'll help you fine tuning this as the custom instruments has to be "visible" by setting GLobal parameter to "True". Take a look into page 24 of the User Guide to see how it looks:
https://www.dukascopy.com/vfhelper/down ... _locale=EN

Cheers

Author:  Stroker [ Thu 02 Feb, 2017, 15:31 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Thanks again, I will send you the first compilable.

Author:  foreignexchange [ Tue 07 Mar, 2017, 12:51 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Thanks Amine :D

Author:  foreignexchange [ Tue 07 Mar, 2017, 12:54 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Salve,

Tried to wite the strategy for EUR/USD and compile, substituting the EUR/USD with the USA500IDX/USD and it compile too with no messages. But the historical tester show a message like:

11:45:53 Strategy tester: java.lang.NullPointerException @ com.dukascopy.visualforex.visualjforex.CNDL_15Min_1H_4H_1D_1W_USA500IDXUSD_Yes.subscriptionInstrumentCheck(CNDL_15Min_1H_4H_1D_1W_USA500IDXUSD_Yes.java:390)

How could be fix ?

Thanks

Author:  amine_chourou [ Wed 08 Mar, 2017, 17:04 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Hi,

This is definitely not the right method unless you know exactly what you're changing and where.
The easiest way is to to switch the default instrument from the run-time parameter window that comes in JForex platform when you start a local run or from instruments menu when using historical tester.
Image
Image

Attachments:
InstChange.JPG [53.72 KiB]
Downloaded 219 times
LocalRunInstr.JPG [33.94 KiB]
Downloaded 229 times

Author:  AU7SZ [ Fri 01 Feb, 2019, 13:59 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Hi,

every strategy i created with an currency and tried to change it to CFD by switching the default instrument (or a new created variable) in the run-time parameter window couldnt be backtested proberly. The backtest gets slower and slower and after some minutes the backtest is so slow that you have to stop it. This happens only when I switch to CFDs, currencies run very smooth in backtest.
The strategy also doesnt open any position with CFDs. Currencies on the other hand are working fine.

Here is a simple strategy that doesnt seem to work with CFDs. Is there anybody who was able to switch any strategy from currencies to cfds? Is it possible?

Image

Attachments:
CFD.PNG [99.86 KiB]
Downloaded 90 times

Author:  vadim_berezhnoj [ Tue 05 Feb, 2019, 16:59 ]
Post subject:  Re: Index and CFD trading with Visual JForex

Hello.

Yes, it is possible.
Please read posts above.

  Page 1 of 1