OrdersTotal in a specif pair of currencies

Aug 15, 2016 at 05:08
667 व्यू
7 Replies
JHenrique
forex_trader_318221
तबसे मेंबर है Apr 07, 2016   32 पोस्टों
Aug 15, 2016 at 05:08
Hi guys!

I have another problem…

I want make this:

if(the number of orders in EURGBP < 2){do it…}

I know the function OrdersTotal(), but I don’t want to know the total, I want to know the total in EURGBP! So, how can I do it?

Thanks again!!
तबसे मेंबर है Aug 20, 2009   266 पोस्टों
Aug 15, 2016 at 06:45 (एडिट हो रहा है Aug 15, 2016 at 06:48)
Use this function :-

int Trade_Count(int My_Magic, string my_symbol)
{
int
   counter = 0;
   for(int i = OrdersTotal()-1;i>=0;i--){
      if(OrderSelect(i,SELECT_BY_POS)>0){
         if(StringFind(OrderSymbol(),my_symbol,0)>-1){
            if(OrderMagicNumber()==My_Magic)counter++;
         }
      }
   }
   return(counter);
}

Function call would be something like :-

Number_of_Orders = Trade_Count(12345, 'EURGBP');

Wealth Creation Through Technology
JHenrique
forex_trader_318221
तबसे मेंबर है Apr 07, 2016   32 पोस्टों
Aug 15, 2016 at 11:22
Didn't work... Something is wrong with syntax of this code...

=((((((((((
तबसे मेंबर है Aug 20, 2009   266 पोस्टों
Aug 16, 2016 at 06:16
Replace the ' around the EURGBP with double quotes('). The website seems to change my original quotes.

Also the Number_of_Orders should be declared as int
Wealth Creation Through Technology
JHenrique
forex_trader_318221
तबसे मेंबर है Apr 07, 2016   32 पोस्टों
Aug 17, 2016 at 10:30 (एडिट हो रहा है Aug 17, 2016 at 10:50)
I tried again, but, without successful...

I think the problem is in the word 'my_symbol'. I substitued it for EURGBP, 'EURGBP' and 'EURGBP' (with and without string before) and the code continues to give problem...
तबसे मेंबर है Aug 20, 2009   266 पोस्टों
Aug 17, 2016 at 12:40
The code is solid. I have tested it via a script. You need to be more specific as to the error that it is giving you. Alternatively, post the mql file and I will have a look at it.
Wealth Creation Through Technology
forex_trader_72824
तबसे मेंबर है Apr 08, 2012   10 पोस्टों
Aug 17, 2016 at 15:47
JHenrique posted:
Hi guys!

I have another problem…

I want make this:
https://monitorfx.pl/

if(the number of orders in EURGBP < 2){do it…}

I know the function OrdersTotal(), but I don’t want to know the total, I want to know the total in EURGBP! So, how can I do it?

Thanks again!!
Didn't work...
तबसे मेंबर है Aug 20, 2009   266 पोस्टों
Aug 17, 2016 at 16:32 (एडिट हो रहा है Aug 17, 2016 at 16:32)
Here is the code in a working script.

अटैचमेंट :

Wealth Creation Through Technology
You must be connected to Myfxbook in order to leave a comment
*व्यवसायिक इस्तेमाल और स्पैम को ब्रदाश नहीं किया जाएगा, और इसका परिणाम खाता को बन्द करना भी हो सकता है.
टिप: किसी चित्र या यूट्यूब या URL को पोस्ट करने से वे अपने आप आपके पोस्ट में आजाएगा!
टिप: @ चिन्ह को टाइप करें उपभोगता के नाम को अपने आप करने के लिए जो इस चर्चा में भाग ले रहा है.