Dukascopy
 
 
Wiki JStore Search Login

IF block can't manage No Value option
 Post subject: IF block can't manage No Value option Post rating: 0   New post Posted: Thu 22 Feb, 2018, 05:07 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Hello, I enclose a picture and a .vfs showing the problem: Even when the IF block offers the option to use No Value, the comparation is not possible.

Image


Attachments:
NoValueBug.zip [8.17 KiB]
Downloaded 213 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: IF block can't manage No Value option Post rating: 0   New post Posted: Thu 22 Feb, 2018, 18:01 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Hello Frangonve,

Can you please explain that what are you trying to achieve on your strategy ? Basically what kind of trading logic are you trying to apply using such a set up of Visual JForex components ?


 
 Post subject: Re: IF block can't manage No Value option Post rating: 0   New post Posted: Thu 22 Feb, 2018, 18:55 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Well, this was only an simplified example to show the problem that I found in the IF block.

I was designing a trade manager. The user would input the Position Id to select the position to be managed and then depending of the market conditions, the SL should be moved accordingly or the trade could be partially/totally closed or additional positions could be added.

I wanted to stop the strategy with an alarm sound if the Position Id typed by the user were empty or incorrect, but I see that using the "No Value" option in the IF block won't do it.

Cheers

Francisco


 
 Post subject: Re: IF block can't manage No Value option Post rating: 0   New post Posted: Sat 24 Feb, 2018, 00:16 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Greetings again,

So did you fix the issue ?

The problem was pretty simple. First of all it was just part of your strategy and more importantly, we can not mismatch something that has been assigned a value with something that hasn't got any value. Such conditions are already colour labelled in the Visual JForex.


 
 Post subject: Re: IF block can't manage No Value option Post rating: 0   New post Posted: Sat 24 Feb, 2018, 07:23 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Hello and thanks for your answer.

I deleted the filter to avoid the warning. But I still think it's a bug giving an option (No Value) in the IF block that doesn't work:

Image

Please let me know how you can program in VJForex to stop a strategy with an audio alert if a required input field like Position ID (string) is empty.

Cheers

Francisco


 
The Best Answer  Post subject: Re: IF block can't manage No Value option Post rating: 1   New post Posted: Sat 24 Feb, 2018, 15:32 
User avatar

User rating: 5
Joined: Thu 04 Aug, 2016, 04:51
Posts: 61
Location: CanadaCanada
Hello Frangonve,

Basically, an Empty String is still a string but a No Value variable equates to nothing, including no such representation of a string.


frangonve wrote:
I deleted the filter to avoid the warning. But I still think it's a bug giving an option (No Value) in the IF block that doesn't work:

It does work as intended but only when it is used correctly!


frangonve wrote:
Please let me know how you can program in VJForex to stop a strategy with an audio alert if a required input field like Position ID (string) is empty.

Please take a look at the following screenshot:
Image


Should you still have any other issues with your strategy, then first please share its .VFS file with us before we may try to tackle any presumed problem/s with it. If in case you wish to keep your strategy private, then directly seeking help from Dukascopy via [email protected] will be the correct action to take.

Cheers!


 
 Post subject: Re: IF block can't manage No Value option Post rating: 0   New post Posted: Sun 25 Feb, 2018, 06:58 
User avatar

User rating: 2
Joined: Fri 27 Jul, 2012, 07:04
Posts: 82
Location: Spain, Paracuellos de Jarama
Hello FXRabbit and thanks for your help.


 
 Post subject: Re: IF block can't manage No Value option Post rating: 1   New post Posted: Wed 14 Mar, 2018, 14:09 
Visual JForex expert at Dukascopy
User avatar

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

I like your workaround guys, it did the job but I need to intervene to explain couple of things:

- "No value" item in the DD list can be used with any variable, The platform will warn you (popup warning) that you can't compare 2 inconsistent variables upon dropping this variable in the IF block.
- The reason of the error that you're getting is not that "No value" parameter doesn't work but because the end of the cycle (of your position viewer) is executed while there is no value attributed yest to this position i.e there are no positions opened yet. You have to understand that when using the out of cycle output, the loop is executed so it goes through your conditions X number of times then it ends with executing the "end of cycle" flow./ The latter is executed anyway even if your condition within the loop are not verified
- The error is then appearing because, in this case, once executed there is no position created yet and Position ID (which is by the way a mandatory tag and couldn't be null) doesn't get assigned with a string / ID

Hope this helps


Attachments:
NoValueBug2.vfs [23.9 KiB]
Downloaded 285 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.
 

Jump to:  

  © 1998-2024 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