You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Sorry actually I have become confused a bit.
if(iOpenOrders_Buy = 3)
Here if the Total Opened Buy order is equal to '3' then the code will proceed to next part.
if(iOpenOrders_Buy > 0)
Then if the Total Opened Buy order's count is greater than '0' then it'll proceed to next.
if(iOpenOrders_Buy == 3)
Then if the Open Buy order count is equal to 3 then it'll open BuyOrder_1, if equal to '2' then it'll open BuyOrder_2 and then BuyOrder_3 is Opened Buy order count is equal to 1.
Am I right?
you're right look again to the changed code is this ok ??
you're right look again to the changed code is this ok ??
I don't think so.
if (Buy Condition Met && iOpenOrders_Buy == 0)
This is meaning that 'Buy Condition is Met' and there is no 'Opened Buy' orders, right?
then the code will Proceed to next line where iOpenOrders_Buy = 3;
So it is told to EA that there is already 3 opened orders there, right?
But if I entering into the code knowing that there is no Open Buy orders there then why we are assigning iOpenOrders_Buy = 3; ?
Also the target is, One of the Three trades will keep running and only 'New' buy order will be opened when that last trade will get closed.
So this has to be
if(iOpenOrders_Buy== 0) // There is no Opened Buy order so we have to open new Buy orders
When the EA will get the Buy condition then it'll Open Three trades with different Take Profit.
Then if two of the trades got closed anyway(by either TP or SL), the third one will keep running.
What do you think about this? Would it do the same as stated above?
Regards
I don't think so.
What do you think about this? Would it do the same as stated above?
Regards
no what happens if ordersend not succeed, how do you check which trade you have to open if one fails
why we are assigning iOpenOrders_Buy = 3; ?
you have to open 3 new trades if ordersend succeed make iOpenOrders_Buy new value
if iOpenOrders_Buy becomes 0 we have our 3 trades
no what happens if ordersend not succeed, how do you check which trade you have to open if one fails
why we are assigning iOpenOrders_Buy = 3; ?
you have to open 3 new trades if ordersend succeed make iOpenOrders_Buy new value
if iOpenOrders_Buy becomes 0 we have our 3 trades
Yes, it is very much possible that 'Ordersend()' fails to open order.
Now I understood why
if(iOpenOrders_Buy > 0) // we have to open new Buy orders
was used in your code. As we already set iopendOrders=3, so it'll verify it.
But later on I got confused that how the value of iopendOrders will keep changing.
Probably for my limited brain I failed to figure out the mechanism. So I tried to implement your logic in the above way.
Is this what you have referred into your given code?
Regards
Yes, it is very much possible that 'Ordersend()' fails to open order.
Now I understood why
if(iOpenOrders_Buy > 0) // we have to open new Buy orders
was used in your code. As we already set iopendOrders=3, so it'll verify it.
But later on I got confused that how the value of iopendOrders will keep changing.
Probably for my limited brain I failed to figure out the mechanism. So I tried to implement your logic in the above way.
Is this what you have referred into your given code?
Regards
Please don't mind but again I have become confused!
If I use
count=count-1; after
Print( "Buy Order 1 Opened successfully");
that means if the first buy order got opened, then value of count will be decreased by 1.
So when entering into next function, here the next 'if' condition:
if (count==2) {}
the value of count has become '2' for it. [count=3-1=2]
Is this right?
Please don't mind but again I have become confused!
If I use
count=count-1; after
Print( "Buy Order 1 Opened successfully");
that means if the first buy order got opened, then value of count will be decreased by 1.
So when entering into next function, here the next 'if' condition:
if (count==2) {}
the value of count has become '2' for it. [count=3-1=2]
Is this right?
try it out.... do some testing
try it out.... do some testing
Tired and this is the Result.
Probably I couldn't place the 'Closing Sell Order before buying' code at the right place. Hence getting Sell and Buy altogether although it's against the Original code.
And there are '4' buying orders altogether!
I failed :(
opps, forgot to put iOpenOrders_Buy ==0
Now testing it again with this.