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

IF block can't manage No Value option
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=141&t=56297
Page 1 of 1

Author:  frangonve [ Thu 22 Feb, 2018, 05:07 ]
Post subject:  IF block can't manage No Value option

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 219 times

Author:  FXRabbit [ Thu 22 Feb, 2018, 18:01 ]
Post subject:  Re: IF block can't manage No Value option

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 ?

Author:  frangonve [ Thu 22 Feb, 2018, 18:55 ]
Post subject:  Re: IF block can't manage No Value option

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

Author:  FXRabbit [ Sat 24 Feb, 2018, 00:16 ]
Post subject:  Re: IF block can't manage No Value option

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.

Author:  frangonve [ Sat 24 Feb, 2018, 07:23 ]
Post subject:  Re: IF block can't manage No Value option

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

Author:  FXRabbit [ Sat 24 Feb, 2018, 15:32 ]
Post subject:  Re: IF block can't manage No Value option

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!

Author:  frangonve [ Sun 25 Feb, 2018, 06:58 ]
Post subject:  Re: IF block can't manage No Value option

Hello FXRabbit and thanks for your help.

Author:  amine_chourou [ Wed 14 Mar, 2018, 14:09 ]
Post subject:  Re: IF block can't manage No Value option

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 292 times

  Page 1 of 1