OrdersTotal in a specif pair of currencies - page 2

 
JHenry:
I don’t know, guy… I’m not felling safe with this code…

The function not should return the number of open orders in EURGBP or ABCXYZ!?!? So why you wrote: 

 if(totalForCurrentSymbol==0){OrderSend…}

After, exist other line that use the function OrdersTotal()

for (int i = 0; i < OrdersTotal(); i++){papapa…)

This function should be substituied by totalForCurrentSymbol.

I will put my money in this EA…

The worse is that I don’t understand of programming and MQL4 and I don’t speak English very well, so, I can’t express correctly and I can’t understand your ideia….

You changed the line of code from

     if (OrderSymbol()      != "EURGBP")            continue;

to :

      if(OrderSymbol()      != "BTCEUR")            continue;

Not me

And you asked in your question to :

JHenry:

...

I want make this:


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

So, please check the first post I have posted regarding that, and use the code any way you will

 

The problem isn't the "BTCEUR" or "EURGBP"...

THe problem is the number that the function totalForCurrentSymbol returns...

If the function totalForCurrentSymbol returns the total open orders in BTCEUR, EURGBP, our ABCXYZ, so why you wrote totalForCurrentSymbol==0 and not <2 ?

The worse is that I already ask for help in several foruns of programming of MQL and I always receive tips that need be worked. I don't know programing.... :(

 
JHenry:

The problem isn't the "BTCEUR" or "EURGBP"...

THe problem is the number that the function totalForCurrentSymbol returns...

If the function totalForCurrentSymbol returns the total open orders in BTCEUR, EURGBP, our ABCXYZ, so why you wrote totalForCurrentSymbol==0 and not <2 ?

The worse is that I already ask for help in several foruns of programming of MQL and I always receive tips that need be worked. I don't know programing.... :(

That "function" does not return any number since that is not a function but a code snippet that should be copy - pasted into your code

That is a code snippet that counts the number of currently opened orders for the chosen symbol (in the line in which you changed the symbol name to BTCEUR you determine which symbol should be counted) and stores that number (the number of currently opened orders for that symbol) in the totalForCurrentSymbolvariable. Use that variable after that code snippet for comparison to do what you wish to do with the stored value comparison as you will

 
JHenry:

The problem isn't the "BTCEUR" or "EURGBP"...

THe problem is the number that the function totalForCurrentSymbol returns...

If the function totalForCurrentSymbol returns the total open orders in BTCEUR, EURGBP, our ABCXYZ, so why you wrote totalForCurrentSymbol==0 and not <2 ?

The worse is that I already ask for help in several foruns of programming of MQL and I always receive tips that need be worked. I don't know programing.... :(

Hi JHenry, actually after reading your post i also dont know what you want .... :P

May be you can check here , i think you can find the answer .

I read this before ....

http://www.forexfactory.com/showthread.php?t=236002 

 
stevenpun:

Hi JHenry, actually after reading your post i also dont know what you want .... :P

May be you can check here , i think you can find the answer .

I read this before ....

http://www.forexfactory.com/showthread.php?t=236002 

What I want is become this EA (ben_trail_stop) multiassets. This works for only ONE pair of currencies per trade account. I want that it work for several pair of currencies in the same trade account. Just it!
:S
 
JHenry:
What I want is become this EA (ben_trail_stop) multiassets. This works for only ONE pair of currencies per trade account. I want that it work for several pair of currencies in the same trade account. Just it!
:S

Did you go to the link i post , second page  have  Ben_trail_stop_v2_ECN  and the latest version 6 on page 3

I think that is what you want .

 
This version, like the others too, no open none position!

It's difficult find an EA that really works... :S
 
JHenry:
This version, like the others too, no open none position!

It's difficult find an EA that really works... :S

OMG.....

Come on , JHenry did you read carefully the post on the link i post ....

Post 2 http://www.forexfactory.com/showthread.php?p=3715292#post3715292

"In order to test it, I have it opening 2 orders(1 buy & 1 sell). You can then run it in visual backtest mode to see it in operation.

When ready to use, just delete the couple of lines at the beginning of the start() function that sends the orders"  

Post 27 http://www.forexfactory.com/showthread.php?p=3744453#post3744453


I have removed the trading portion of this EA. I placed the original trades as a way to test the EA. The results are misleading as you cannot see the drawdown that is created by leaving trades open indefinitely. It could quite easily blow your account.

The idea behind this EA, is that you make your trade and then you can set the EA on it to run a trailing stop for you in order to let your winners run. It is a way of maximising your pips without having to sit in front of the computer. Please note, there is no regular stoploss, this EA uses stoploss to exit when you have a profit. If your trade runs into the negative, it is up to you to determine your own exit strategy.

The author just want to test the ea...

Simple way you can copy the code and place it on the latest version , but i think it will randomly  open trade because it not a trading ea ,it is a

trail stop lose ea .....

int start()
{
   if(OrdersTotal() <2){
      OrderSend(Symbol(), 0, 1, Ask, 3, 0 ,0 ,0, 123, 0,CLR_NONE);
      OrderSend(Symbol(), 1, 1, Bid, 3, 0 ,0 ,0, 123, 0,CLR_NONE);
   }
Reason: