How to stop a secuence in a EA - page 2

 

Ok WHRoeder, you win, I give up posting here, I guess that you are pretty boring, just wasting your time to bothering people.

I don´t want to learn how to program in mql4, I don´t need it and I don´t have time for that. I just need a simply code, get it.

 
zenithb:

Ok I changed NULL for 0.

I tried to see if the condition works, but it doesn´t. Do you know why?


OrderSend() does not return a bool it returns and integer

Try . . .

if (OrderSend("EURUSD",OP_BUY,0.1,0,0,0,0) > 0)  {
   Alert( "WORKS");
  }  
 
Yes thank you RaptorUK. I know this should be simple, I´m trying to figure out and understand how to do program it, still I didn´t get it.
 
//--------------------------------------------------------------------
// simpleopen.mq4 
// The code should be used for educational purpose only.
//--------------------------------------------------------------------
int start()                                  // Special function start()
  {                                          // Opening BUY
   OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);
   return;                                   // Exit start()
  }
//--------------------------------------------------------------------
Hey RaptorUK. Actually I got the code for my EA from this site, what I did is changed Symbol for the pair that I want to trade, and then adding the rest of the pairs. What do you mean saying  OrderSend() does not return a bool it returns and integer?
 
zenithb:
Hey RaptorUK. Actually I got the code for my EA from this site, what I did is changed Symbol for the pair that I want to trade, and then adding the rest of the pairs. What do you mean saying  OrderSend() does not return a bool it returns and integer?

The   "and"   was a typo,  it should be OrderSend() does not returns a bool it returns an  integer.  When you call OrderSend() it gives a value back to you,  if the OrderSend() worked it gives you back the trade ticket number,  if it fails it gives you a  -1

 

So . . .

int TicketNumber;

TicketNumber = OrderSend(Symbol(),OP_BUY,0.1,Ask,3,Bid-15*Point,Bid+15*Point);

if(TicketNumber < 0)
   Print("OrdrSend failed,  error # ", GetLastError() );

else
   Print("Yipeee,  my Ordersend worked ! !");
 
zenithb: OrderSend() does not return a bool it returns and integer?
Had you bothered to RTFM at OrderSend - MQL4 Documentation you would have seen
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
What part of int was unclear?
I don´t want to learn how to program in mql4, I don´t need it and I don´t have time for that. I just need a simply code, get it. (emphasis added.)
Since there are no slaves here, normally you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem. Since you don't want to learn. And simple code will not help, you should go here
 

WHRoeder, is unbeliavable that you are still fucking around. If you have a shitty life, go fuck yourself and don´t try to be arrogant because you are coding for long time ago. Who are you, my school teacher? people ask here just to solve what they need, not to hear your bullshit.

So now I will tell you the 3 options that you have in your miserable and boring life:

1- Make more coding

2- Watch porn

3- Go fuck yourself

Fortunately I solved the problem of my EA in another forum, jusk asking in the same manner what I did it here.

 
By the way, thanks RaptorUK for your help.
 
zenithb:
By the way, thanks RaptorUK for your help.
You are welcome but there was no need for the foul language,  enjoy your Ban and take the opportunity to learn some more mql4.
Reason: