Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1958

Fernando Carreiro  
Buckets #: What is the MQL4 command to place a label at the level of a horizontal line. For example, a horizontal line is at a calculated value and I would like to label it with its properties, at the price level on the left hand side of the chart.  I have the label set up, printing and ready on the X axis but I can't work out how to define the label Y axis to the value of the horizontal line. 

It depends. If you want it on the Left hand side, then simply give the horizontal line a description and it will apear there.

On the right hand side however, it is not that easy. You have to place either a text object or a object label object depending on what you want to achieve.

If you want it always visible as you scroll the chart then a Label object will be best, but you will have to compensate for vertical shift of the chart.

If you only want it visible on the current most recent bar, then you can use a Text object, but you will have to update its position on every new bar.

Keith Watford  
Buckets #:

Note for Fernando Carreiro and William Roeder - Thanks for your comments re my previous.  I posted that non-compilable piece of code because I was requested to do so by Keith Watford, who I understand is a moderator. 

I requested that you post your code, I didn't ask for you to post code that will not compile. You had not mentioned anything about getting compilation errors.

Tom Berwick  

Is there a step by step guide for setting up a Signal Follow purchase?  I've got to say there is very little current info or videos that is readily available to guide that journey.  The one "detailed" video for starting the subscription is a link to a 6-yr old Youtube video.  Very disappointing.

TCB

Buckets  

All sorted thanks to the references.  Used text not label.

Buckets  
Keith Watford #:

I requested that you post your code, I didn't ask for you to post code that will not compile. You had not mentioned anything about getting compilation errors.

OK, my misunderstanding.  Apologies!!

Lorentzos Roussos  
Tom Berwick #:

Is there a step by step guide for setting up a Signal Follow purchase?  I've got to say there is very little current info or videos that is readily available to guide that journey.  The one "detailed" video for starting the subscription is a link to a 6-yr old Youtube video.  Very disappointing.

TCB

There is a newest thread here :

https://www.mql5.com/en/forum/189731

How to Subscribe to a MT4 Signal (new instructions, after 1065 version upgrade) - How to subscribe to a MΤ4 signal on MT4 platform
How to Subscribe to a MT4 Signal (new instructions, after 1065 version upgrade) - How to subscribe to a MΤ4 signal on MT4 platform
  • 2017.04.10
  • www.mql5.com
In the   deviation/slippage   field, select an option and click   ok   in the   options   window to close it. Go to the   search area   of your mt4 platform, on the upper right corner (where the magnifying glass is), type in the name of the signal you want to subscribe and click   enter
Enki101  

Hello,

- RE: FXPT_BuySellUnlimitedOrders

what should I change in the codding in order to make it work on my MT4?

-Please help... Thanks!


//+------------------------------------------------------------------+

//|                                   FXPT_BuySellUnlimitedOrders.mq4|

//|                                         Developed by fxprotrader |

//|                                     http://www.fxpro-trader.com" |

//+------------------------------------------------------------------+

#property copyright "Copyright © 2011, fxprotrader"

#property link      "http://www.fxpro-trader.com"

//-------- HISTORY----------------

// v0.1 Initial release(013012)

//--------------------------------

//coded for Price

//http://www.forexfactory.com/showthread.php?p=5335422#post5335422

 

#property show_inputs

 

extern string   TopComment1="Check Symbol and Order type";

extern string   TopComment2="Must select Buy or Sell";

extern bool buyorder  = FALSE;

extern bool sellorder = FALSE;

extern int NumberOfOrders = 5;

extern double Lots     = 0.10;

 extern int   StopLoss =   40;

 extern int   TakeProfit=  10;

 extern int   TPFactor  =  10;

 extern int MagicNumber = 999;

 extern string   MyComment="";

 string TradeComment="FXPT_BuySell ";

int Slippage=2;



 double Poin;



//+------------------------------------------------------------------+

//| Custom initialization function                                   |

//+------------------------------------------------------------------+

int init(){



   if (Point == 0.00001) Poin = 0.0001;

   else {

      if (Point == 0.001) Poin = 0.01;

      else Poin = Point;

   }

   return(0);

}

//+------------------------------------------------------------------+

//| script program start function                                    |

//+------------------------------------------------------------------+

int start(){



double BP,SP,TP,SL,HashLn;

int ticket;

int c,x,err;

int NumberOfTries=5;





//BUY

 if(buyorder == TRUE){  

 

for(x=0;x<NumberOfOrders;x++){

TakeProfit+=TPFactor;

for(c=0;c<NumberOfTries;c++){

RefreshRates();

  SL=Ask-(StopLoss*Poin);

TP=Ask+(TakeProfit*Poin);

 ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,Slippage,0,0,TradeComment+DoubleToStr(StopLoss,0)+"/"+DoubleToStr(TakeProfit,0)+" "+Period(),MagicNumber,0,Blue);

   err=GetLastError();



if(ticket>0){

if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)){

   OrderModify(ticket,OrderOpenPrice(),SL,TP,0,Blue); 

}

}

 if(err==0){break;}

else{

    Print("Errors opening BUY order err:"+err);

     if(err==4 || err==137 ||err==146 || err==136){

     Sleep(100);continue;//Busy errors

     }

     else{break;}//normal error

     

}



}//for error/NumberOfTries

}



 return(ticket); 



}



//sell

else if(sellorder == TRUE){ 



for(x=0;x<NumberOfOrders;x++){

TakeProfit+=TPFactor;

for(c=0;c<NumberOfTries;c++){

RefreshRates();

  SL=Bid+(StopLoss*Poin);

TP=Bid-(TakeProfit*Poin);

 ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,Slippage,0,0,TradeComment+DoubleToStr(StopLoss,0)+"/"+DoubleToStr(TakeProfit,0)+" "+Period(),MagicNumber,0,Red);



   err=GetLastError();

if(ticket>0){

 if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)){

    OrderModify(ticket,OrderOpenPrice(),SL,TP,0,Red); 

}

}

   if(err==0){break;}

else{

    Print("Errors opening SELL order err:"+err);

     if(err==4 || err==137 ||err==146 || err==136){

     Sleep(100);continue;//Busy errors

     }

     else{break;}//normal error     

}

}//for error/NumberOfTries

}



return(ticket); 

}

// } 

}
Adenekan Ogungbola  
Artyom Trishkin:

In this thread I want to begin to help those who really want to understand and learn programming in the new MQL4 and want to easily switch to MQL5 - the languages are very similar.

This blog will be a good place to discuss tasks, algorithms of their solution and any other questions concerning MT programming one way or another.

I hope that other experienced members of our forum will join us and this thread will be interesting to all.

Hello, I am new to MT4 programming. I just started to learn Forex trading in August 2022 and I would like to codes to make my trading more efficient. Is there an active forum I can join for help with the coding instructions. I have had experience coding in Dbase many years ago.
Warren Taylor  

Can someone help me please. I opened a Meta Trader 4 account with some bloke from overseas. I was very green with this type of trading but wanted to learn.  When I wasn't willing to dump half my savings into this account and trust him with it, he left me high and dry. I've been tyring to contact him for over 12 months but no reply or help. I was trading on my own for a while and made a profit. I want to transfer the funds into my new MQL5 account but there's nowhere on the MQL4 page that will allow me to withdraw funds. I've tried the chat thing on this site, but the robot doesn't understand. Who can I call about this issue?

Thanks, Warren 

Fernando Carreiro  
Warren Taylor #: Can someone help me please. I opened a Meta Trader 4 account with some bloke from overseas. I was very green with this type of trading but wanted to learn.  When I wasn't willing to dump half my savings into this account and trust him with it, he left me high and dry. I've been tyring to contact him for over 12 months but no reply or help. I was trading on my own for a while and made a profit. I want to transfer the funds into my new MQL5 account but there's nowhere on the MQL4 page that will allow me to withdraw funds. I've tried the chat thing on this site, but the robot doesn't understand. Who can I call about this issue? Thanks, Warren 

You fell for a scam! That was a fake broker. MetaQuotes is software company, not a broker.

No one here is going to be able to help you. You should address the issue with the authorities or a lawyer.

Tips to avoid being scammed …
Tips to avoid being scammed …
  • 2022.06.07
  • www.mql5.com
Be it by fake agents, brokers, signals, or EAs, there is one weapon to beat them all — knowledge...