Dukascopy
 
 
Wiki JStore Search Login

How to use conditions TRUE/FALSE?
 Post subject: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Mon 28 Nov, 2016, 15:48 
User avatar

User rating: 1
Joined: Fri 11 May, 2012, 12:05
Posts: 12
Location: Romania, Iasi
Dear Amine and Dukascopy community,

I have a strategy which I want to implement on a live account.
The strategy is more complex but I simplified it to be able to solve the problems more easily.
What I what to do is to send a sell order when the prices reaches a certain price and then if it goes in my favor and touches a predetermined price to mark this CONDITION as TRUE and afterwards to close the position on breakeven if it stops going in my favor.

On the Visual Jforex backtester it works properly but not so on a Demo account. At the same time the strategy keeps opening positions without stopping even if I added a few filters as suggested in other posts (as commenting the position and filtering the instrument).

I have to mention I don't want to use trailing stops, I just want the strategy to memorize a CONDITION as true/false if it touches a certain price and use this condition later on.

Please guide me in the right directions as I want to make this work.
Thank you.


Attachments:
StrategyTest1.java [17.24 KiB]
Downloaded 148 times
StrategyTest1.vfs [45.06 KiB]
Downloaded 168 times
jforex.JPG [211.63 KiB]
Downloaded 212 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Mon 28 Nov, 2016, 16:40 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

I've noticed a "strange way" to filter candle's period and instrument which looks logically correct but I think it was generating inconsistencies at the level of Jforex testing engine as well as live run. I've modified this as you can see in the attached version and made a quick test on live run mode. It looks okay but I'll let you test this thoroughly.

Thanks


Attachments:
StrategyTest1_V1.vfs [46.3 KiB]
Downloaded 163 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Tue 29 Nov, 2016, 09:14 
User avatar

User rating: 1
Joined: Fri 11 May, 2012, 12:05
Posts: 12
Location: Romania, Iasi
Half of the problem is solved. The fix for limiting the open positions worked, thank you.

To be able to understand the other half of the problem I simplified the strategy once more.

What I want the strategy to do now is this:

If the Bid is above MY_PRICE
then SELL at the market.

It doesn't work. The strategy opens the position after a few seconds ignoring the condition imposed.
Did I do something wrong?
Thank you again.


Attachments:
StrategyTest1_V1c.jfx [20.28 KiB]
Downloaded 158 times
StrategyTest1_V1c.vfs [44.67 KiB]
Downloaded 153 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Tue 29 Nov, 2016, 11:42 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Thank you for the additional information.
I've noticed this issue as well. I'll get back to you asap.

Cheers


 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Fri 16 Dec, 2016, 21:22 
User avatar

User rating: 1
Joined: Fri 11 May, 2012, 12:05
Posts: 12
Location: Romania, Iasi
Any news on this?
Or maybe other ways to accomplish the same thing?


 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Mon 19 Dec, 2016, 10:49 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

Sorry for the late answer.
Do you still face the same issue ? I've tested this and results seems to be okay on VJF vs JF.
Do you test using Jforex 3 or 2 ?

Thanks


 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Mon 19 Dec, 2016, 14:08 
User avatar

User rating: 1
Joined: Fri 11 May, 2012, 12:05
Posts: 12
Location: Romania, Iasi
Hi,
Yes, the problem is still there. I tested Jforex2 and Jforex3.

I'll write my steps for testing it:
When I start the strategy I set the parameter RedPrice to a price above current market price.
The strategy should sell when the Last Bid gets there.

Actual results: the strategy opens a market sell order immediately after I start the strategy instead waiting for RedPrice to be touched.

Yes I know it works in VJF ... but I can't use it for live trading.


 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Tue 20 Dec, 2016, 17:28 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Alright,
I'm currently having random results with the same strategy but only on real time run. I'll check this tomorrow and update you.

Thanks


 
The Best Answer  Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Thu 22 Dec, 2016, 18:00 
Visual JForex expert at Dukascopy
User avatar

User rating: 288
Joined: Thu 18 Apr, 2013, 09:26
Posts: 1496
Location: Switzerland, Geneva
Hi,

We found the issue: The problem comes from the way the strategy is subscribing to the traded instrument: In this example is takes the candle's instrument which is okay at the level of Visual Jforex. But in Jforex, this is not enough as the strategy subscribes to all instruments thus it takes "Last tick price "from another pair and compare it with 0.756 and once the condition is verified it opens a trade on AUDUSD.
TO avoid that you have to filter properly the traded instrument as follow:


Image


Attachments:
InstrSubs.JPG [98.87 KiB]
Downloaded 343 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: How to use conditions TRUE/FALSE? Post rating: 0   New post Posted: Wed 28 Dec, 2016, 09:43 
User avatar

User rating: 1
Joined: Fri 11 May, 2012, 12:05
Posts: 12
Location: Romania, Iasi
Thank you very much Amine.


 

Jump to:  

  © 1998-2025 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com