How to do one trade per contition?
-
how to do this
i have same problemgive me a images
-
Hi!
I´m making a simple robot with SAR. The conditions are:
-When SAR < Candle = buy- When SAR > Candle = sell
But the problem is that when the transaction closes (TP, SL or Manually), another trade opens again. I want to open ONCE for each condition. I want that when closed wait for a new different condition (the opposite condition).
How can I do?
Thanks.
......
1.mq4 -
Block "Once per bar"?
-
Hi, thanks for your time.
If I take the block "once per bar", the condition before could be still present.
The question is once the robot closes the transaction don´t open it again if still the condition. Once trade per condition and then the robot waits to the opposite condition. Once buy, once sell.
Another way that I could serve: When the condition mets, open a trade and then go to wait the opposite condition.It´s possible?
Thanks for you patience.
-
Try this:
No trade is running (set this to Buys) -> Condition (to buy) -> Close trades -> Buy now
No trade is running (set this to Sells) -> Condition (to sell) -> Close trades -> Sell now -
It doesn´t works, but tanks.
It´s supose to be something like this but it doesn´t works neither, I don´t know why.
No trade is running > Condition > Counter Pass Once (ID= 1) > Counter reset (ID =2) > Buy
No trade is running > Condition > Counter Pass Once (ID= 2) > Counter reset (ID =1) > SellEvery time it Buy, it prepare to the following condition (sell), but just once per condition. When the trade is finish, the robot waits to the opposite condition.
I think that´s it´s the logical chain of blocks, but It´s doesn´t works. The robot buys a lot times in the same condition. -
It works for me:
https://fxdreema.com/shared/A7q8CbIUd
http://prntscr.com/7200fu -
Hi,
Yes, you are right, but if the trade closes, the robot opens again in the same condition. I need that if it closes, it doesn´t open again in this same condition. It has to wait to the opposite condition to open a new trade.
I´m tying to do this with counters and reset counters, but the robot continues to opens again once the trade closed (if the condition persist).
https://fxdreema.com/shared/iO3JXwpfd
It is something wrong in this robot?
And the question is ONE trade for each condition.
I now it´s a little complicated...

Thanks for your patience.
Very good software. Now I´m a member!

-
There was a special block for this in the past, but I decided to remove it. The problem for me is that temporary variables are used to remember the current state, and imagine what happens when you restart the EA - they reset. Now I believe that it's better to use the trades as a storage for the current state, to check for their count and properties before doing something.
So, counters are probably working, but I'm not thinking in this direction. If you think that this works for you, fine.
Here is another way - to check what was the type of the last closed trade before checking conditions. If it was Sell - you are going to check conditions to Buy. There is a block with stupid name for this - "Check last closed type"
In your project I don't like these "check type" blocks placed there. These are supposed to work in different scenario. And by the way, there are filters in "Close trades" to choose what to close - Buys or Sells.
-
Finally...
we did it! 
That´s it.... perfect!

Thank you so so much!!!!!!!
-
sir plz anser
-
i need one too,plss
-
once for trade block
can some give me an axample?plss