No trade nearby - case 1: and case 2: something missing
-
@fxDreema may I ask you for one short example how "no trade nearbly" works in particular? I'm having issues with finding it out, whilke it seems it could be useful block. Thank you!
-
I type it here in reports ...
block No trade nearby
in condition after case 1: and case 2: for side direction (opening in winning or losing side) must be some condition to deny opening trades when price is above/bellow order open price (depends on direction type and trade type), condition can be like:
(price <= OrderOpenPrice()) || ( ...
without this it results in opening trades one after another ... (not necessary opening trades, but true - orange output)can you check it please?

here is working example (conditions added manually in code for case 1: and case 2:):
{ if (use_current_price) {price = SymbolAsk(SYMBOL);} switch (RangePosition) { case 0: if (price <= (OrderOpenPrice() + distance/2) && price >= (OrderOpenPrice() - distance/2)) {next = false;} break; case 1: if ((price <= OrderOpenPrice()) || (price <= OrderOpenPrice() + distance && price >= OrderOpenPrice())) {next = false;} break; case 2: if ((price >= OrderOpenPrice()) || (price <= OrderOpenPrice() && price >= OrderOpenPrice() - distance)) {next = false;} break; } } else { if (use_current_price) {price = SymbolBid(SYMBOL);} switch (RangePosition) { case 0: if (price <= (OrderOpenPrice() + distance/2) && price >= (OrderOpenPrice() - distance/2)) {next = false;} break; case 1: if ((price >= OrderOpenPrice()) || (price <= OrderOpenPrice() && price >= OrderOpenPrice() - distance)) {next = false;} break; case 2: if ((price <= OrderOpenPrice()) || (price <= OrderOpenPrice() + distance && price >= OrderOpenPrice())) {next = false;} break; } } -
%(#FF0000)[(price <= OrderOpenPrice()) || ( ...]
You want to use this, because you want each Buy trade to be created above all other Buy trades? But then this block turns from "No trade nearby" to something else. Now "No trade nearby" means that you can have trades located far away above or below the current price, not only above or only below. Do you actually want to get the maximum OpenPrice in a group of trades and compare it with the current price?
-
with this:
https://fxdreema.com/shared/6t5hn3Qteyou get this:
https://ctrlv.cz/aSAE- you see, trade after trade into "clean side"
You want to use this, because you want each Buy trade to be created above all other Buy trades?
No, when "if" in "case" is true, it runs this variable: " {next = false;}"
{next = false;} - it means, that next condition (or whatever else) "is not executed"
if you add "(price <= OrderOpenPrice()) || ( ..." into case 1 and case 2 as I mentioned (or something else) - you stop this issue, it is issue in block ... check it please
-
But if you have 1 trade and the price goes below it's OpenPrice, the price is now away from this trade. I mean, from the zone between OpenPrice and 10 pips above it. This is when "At the winning side" is used.
If I put price <= OrderOpenPrice(), the "No trade nearby" will never pass if the price is below OpenPrice of the highest Buy trade. Even if there is 1 trade only, the block will never pass if the price is below trade trade.
I think we have different opinion about this "At the winning side" option

-
I am going provide you once again with more detailed way, why now is No trade nearby not working properly, more detailed pictures

-
Here it is ...
I made easy EA and you can test it:
https://fxdreema.com/shared/5C9u5gPZcsome settings:
https://ctrlv.cz/Mxmstry 10p winning side:
https://ctrlv.cz/lYY3
did you see randomly open into losing side? something is not oknow 10p into losing side:
https://ctrlv.cz/vIEB
did you see randomly open into wining side? something is not oknow 10p into both sides:
https://ctrlv.cz/YOHi
here is all working okthis randomly opening is because of missing logic after Case conditions as I typed above ....
how can I avoid this randomly opening? please again, check it ...

-
But I believe that this is the way this block should work

-
is this right (expected) behavior for block No Trade Nearby?

-
this is what is No trade nearby making now, randomly opening in opposite side (batch opened trades - red lines not respected pips offset and not respected direction for winning and lossing side):
where is point of this randomly opened trades placed trade after trade (without respecting pips offset), you are sure this is not bug?
it goes only for winning and lossing mode, mode both is OK, but these two ... need be checked
-
Again, I believe that we understand the word "winning side" differently.
Back then, people wanted to check if there are orders around the current price. If the current price is let's say 100, are there orders around that price - either above or below the price? This is the question, are there orders nearby? Not only above or only below, but nearby, above OR below the current price.
And I added this option for flexibility. Each order has some invisible range around its OpenPrice and if the current price falls into this range, then the trade is too close and the block won't pass. The option only allows to shift the range a little bit. But again, that range is few pips around OpenPrice, few pips above the OpenPrice or few pips below the OpenPrice. That range is NOT from 0 to few pips above the OpenPrice. It's also not from few pips below the OpenPrice to infinity.
If you have one Buy trade at 100 and the current price is 50, then this trade is not nearby 50, because 100 is far far away. The trade is somewhere above in the skies, but not nearby 50. Also, there can be Buy trade at 25, which is still far away from 50.
This is the way I made this block, what can I do now
Maybe there can be another set of options to choose between Above and Below/Only Above/Only Below, but my initial idea of the block was as I explained. It just happens that multiple trades are created when working with the winning side. -
https://ctrlv.cz/shots/2016/09/23/Sko1.png
https://ctrlv.cz/shots/2016/09/23/iSIQ.png
I can not explain it better

If somebody meet same problem as I, he can read first post and find solution

-
I understand that you have problems with the block
But I'm also trying to explain how this particular block now works. I believe that we are thinking about different things when we say "winning side" 
If you want any new Buy trade to be opened only above the latest Buy trade, there is a way to do this as well, with different blocks. Something like this: https://fxdreema.com/demo/mt4-loop-add- ... me-on-loss
-
For this block you can read the descriptions of its parameters, I updated them lately and I tried to explain all details there. Just click over the name of some parameter. I was also trying to make some example, but I stopped for some reason, I don't remember why

-
@fxdreema Thank you for your support but a little question:
Hello, I was wondering why this is not working like the people suspect how it should work.
Why 100 and 50 limits its range? You say, that this is far far away or somewhere in the skies... thats true but why you make a limit to it? Lets say if price is 12300 (DAX) and you have open a buy position. You adjust the block to "FIlter by Type: Buy" and 500 pips at the losing side. When the price falls down to 12250 the block passes true. In my opinion (and I think most of the users will agree) it is the more logical functionality for this block.Regards
-