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
You are dead wrong. Your code never gets executed !!!. Use RaptorUK's.
Okay :)
I simply got confused by this:
"finish when j = 0"
thanks!
So it should look like this:
because you wrote this:
or am I wrong?
You are wrong . . . take a look at this: for
In my code expression 2 is j >= 0 meaning . . . while ( j >= 0 ) so the loop executes while j is 0 or greater, i.e. from OrdersTotal() - 1 down to and including 0
If you use j = 0 (maybe it would have to be written j == 0) it means while (j == 0) and the loop only executes when j is 0
No, do this . . .
The first order position is 0 so if you have 5 orders the positions are 0, 1, 2, 3, 4 . . . so the last is OrdersTotal() - 1 . . . so to count down you start at OrdersTotal()-1 and end at 0
Does this mean that OrdersTotal () -1 is No Orders , then 0 is 1st order, 1 is 2 orders and so on to 4 which equal the 5 orders.
Would someone let me know if my understanding that -1 is equal to No orders , is this correct ?
Thanks
Does this mean that OrdersTotal () -1 is No Orders , then 0 is 1st order, 1 is 2 orders and so on to 4 which equal the 5 orders.
I also need help concerning the same issue. I'm a novice coder and I've been trying to input the code I saw here but its not working at all can you help me. The Orderselect was used
to replace OrdersTotal and control number of trades each EA makes but now the others won't place trades
&& res == false
Orderselect will return true if it selected an order.
Maybe you can use a magic number in combination with the symbolname.
Here is an example in article you can study: https://www.mql5.com/en/articles/1359
b as no value, OrderSelect fails. bM as no value, OrderSelect fails. s as no value, OrderSelect fails. sM as no value, OrderSelect fails.
You buy at the Ask and sell at the Bid.
Your buy order's TP/SL (or Sell Stop's/Sell Limit's entry) are triggered when the Bid / OrderClosePrice reaches it. Using the Ask±n, makes your SL shorter and your TP longer, by the spread. Don't you want the specified amount used in either direction?
Your sell order's TP/SL (or Buy Stop's/Buy Limit's entry) will be triggered when the Ask / OrderClosePrice reaches it. To trigger at a specific Bid price, add the average spread.
MODE_SPREAD (Paul) - MQL4 programming forum - Page 3 #25
The charts show Bid prices only. Turn on the Ask line to see how big the spread is (Tools → Options (control+O) → charts → Show ask line.)
Most brokers with variable spread widen considerably at end of day (5 PM ET) ± 30 minutes. My GBPJPY (OANDA) shows average spread = 26 points, but average maximum spread = 134.
Code it like this :
Please can I use this code in my project