• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 2:00am
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 2:00am
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

Help - any tools that can easily convert MQL4 code to Easy Language code? 7 replies

I need help about afl to mql4!!! please help to me 0 replies

MQL4 Language Most Recent Version is it updated beyond the tutorial on the mql4 websi 6 replies

Need some help with MQL4 code... 1 reply

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
Tags: Need help with this part of code mql4
Cancel

Need help with this part of code mql4

  • Post #1
  • Quote
  • First Post: Jan 19, 2017 4:44am Jan 19, 2017 4:44am
  •  Waddah
  • | Joined Aug 2015 | Status: Member | 76 Posts
hello...
I need help to code this case :

at certain price I have active orders and pending orders , haw to get the sum of pending orders lots ????

Example :
BUY_STOP with lot 0.1
BUy_Stop with lot 0.3
------------------------------------
Total lot size : 0.4


thanks
  • Post #2
  • Quote
  • Jan 19, 2017 6:47am Jan 19, 2017 6:47am
  •  rockit
  • Joined Oct 2013 | Status: Member | 917 Posts
Loop through all (non historical) orders; select order and look if order type is above 1 (indicating a pending order);
if so, get order lots and add to existing lot size.

double lots = 0;
for(int i = OrdersTotal()-1; i >= 0; i--) {
if(OrderSelect(i, SELECT_BY_POS) && OrderType() > 1)
lots += OrderLots();
}
..
 
1
  • Post #3
  • Quote
  • Last Post: Jan 19, 2017 7:20am Jan 19, 2017 7:20am
  •  Waddah
  • | Joined Aug 2015 | Status: Member | 76 Posts
Quoting rockit
Disliked
Loop through all (non historical) orders; select order and look if order type is above 1 (indicating a pending order); if so, get order lots and add to existing lot size. double lots = 0; for(int i = OrdersTotal()-1; i >= 0; i--) { if(OrderSelect(i, SELECT_BY_POS) && OrderType() > 1) lots += OrderLots(); }
Ignored


thanks So much ..............
 
 
  • Platform Tech
  • /
  • Need help with this part of code mql4
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023