|
OR logical operator |
m1nich
|
Post subject: OR logical operator |
Post rating: 0
|
Posted: Thu 23 Jun, 2016, 11:43
|
|
User rating: 1
Joined: Thu 23 Jun, 2016, 11:36 Posts: 45 Location: AustriaAustria
|
Hi, how can I make the equivalent of an OR logical operator. I know that AND operators are effectively done when connecting 2 or more IF blocks. But I'm not sure about OR operators e.g "IF SMA>20 OR EMA>25". Do I use the Multiple Actions block? thanks.
|
|
|
|
 |
amine_chourou
|
Post subject: Re: OR logical operator |
Post rating: 0
|
Posted: Thu 23 Jun, 2016, 13:21
|
|
Visual JForex expert at Dukascopy |  |
User rating: 288
Joined: Thu 18 Apr, 2013, 09:26 Posts: 1496 Location: Switzerland, Geneva
|
Hi,
Yes that's right: The flow will be distributed in a parallel way with the help of "multiple action " block which is equivalent to "OR" logical operator.
Cheers
|
|
|
|
 |
m1nich
|
Post subject: Re: OR logical operator |
Post rating: 0
|
Posted: Tue 05 Jul, 2016, 09:00
|
|
User rating: 1
Joined: Thu 23 Jun, 2016, 11:36 Posts: 45 Location: AustriaAustria
|
Thanks very much. So if I have a multiple action box with two outputs (the equivalent of an OR statement) leading to a buy order, is there a risk that if both OR conditions are true it could place two orders instead of one. Hopefully not.
If someone were writing the actual code for such a situation I presume there could only be one buy order placed regardless as to whether the two OR statements being true or only one being true.
|
|
|
|
 |
amine_chourou
|
Post subject: Re: OR logical operator |
Post rating: 0
|
Posted: Tue 05 Jul, 2016, 11:52
|
|
Visual JForex expert at Dukascopy |  |
User rating: 288
Joined: Thu 18 Apr, 2013, 09:26 Posts: 1496 Location: Switzerland, Geneva
|
Actually I was mistaken: The multiple action block is a simple distribution of the flow and it is equivalent to AND It can be associated to an IF condition as you said (true/false) which should perform the logical operation "OR".
So to summarize, to do an "OR" an IF condition is required: IF yes -->executed A / IF No --> Execute B
You can attach your piece of blocks if you wish and I'll input comments if needed.
Thanks for insisting on this !!
|
|
|
|
 |
m1nich
|
Post subject: Re: OR logical operator |
Post rating: 0
|
Posted: Tue 05 Jul, 2016, 14:35
|
|
User rating: 1
Joined: Thu 23 Jun, 2016, 11:36 Posts: 45 Location: AustriaAustria
|
That's no problem at all. If only I got a dollar for every mistake I've made......
OK - attached is the vsf for what I think is an OR statement based on IF blocks. So it means IF(RSI_30 > 80) OR (RSI_20 < RSI_30) THEN SELL. Seem right to you? And if so, what would happen if both conditions are true. They would both feed into the SELL block, so does anything stop them opening two sell trades if both conditions are true?
If coding this in Java, it would open only one sell trade because there is only one output regardless if one or both conditions are true. But in VJF there are 2 flow outputs to the sell block.
thanks.
Attachments: |
OR_statement_as_IF_blocks.vfs [21.72 KiB]
Downloaded 116 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.
|
|
|
|
|
 |
amine_chourou
|
Post subject: Re: OR logical operator |
Post rating: 0
|
Posted: Wed 06 Jul, 2016, 18:25
|
|
Visual JForex expert at Dukascopy |  |
User rating: 288
Joined: Thu 18 Apr, 2013, 09:26 Posts: 1496 Location: Switzerland, Geneva
|
Hi,
That's correct. I've edited your file for testing purpose, feel free to test and let me know if any question
Cheers
Attachments: |
OR_statement_as_IF_blocks_V2.vfs [23.44 KiB]
Downloaded 142 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.
|
|
|
|
|
 |
|
Pages: [
1
]
|
|
|
|
|