[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 154

 

Thanks Vinin!!!


Yes, also VininI_HMA as well - I haven't seen a better one yet).

 

I wrote a script. Seems simple as can be.

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

//| send_sell.mq4 |
//| Copyright © 2008, Mukata |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, Mukata"
#property link ""

//+------------------------------------------------------------------+
//| script program start function |
//+------------------------------------------------------------------+
int start()
{
//----
double sl=Bid-0.01, tp=Ask+0.01;
int tiket=OrderSend("EURUSD",1,0.01,Ask,3,sl,tp,"",100,0);
int rrr=GetLastError();
Comment(tiket," ",rrr," ",sl," ",tp);
//----
return(0);
}

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

Comment writes in the corner: -1 130... Stops at 100 pips, what's wrong with them?

Help!...

 

Try to write:

 double sl =Bid+Point* StopLoss;
 double tp=Bid-Point* TakeProfit;   

Where stops (StopLoss, TakeProfit) should be in whole numbers (pips)

And the sale itself should be done at the bid price (and not at the ask price).

 
rid >> :

Try to write:

Where stops (StopLoss, TakeProfit) set in whole numbers (pips)

and I should sell at Bid price (and not at Ask price).

It turned out to be easier, I was calculating stops as for buy...

double sl=Bid - 0.01, tp=Ask + 0.01; :-)

and Ask+ and Ask-...

The least of these...

Thanks anyway rid


New code:

int start()
{
int tiket=OrderSend("EURUSD",1,0.01,Bid,3,Ask+0.01,Bid-0.01,"",100,0);
return(0);
}

 

I do not know what is the problem with the application of the 12_VinI_HMA.mq4 indicator

Maybe a wrong closing condition or poorly described data from the indicator

//---------------
      if( VininI_fast == -1)       
      {
         Trade_Signal = 2;
         Print("------------------    ","CLOSE BUY","   ------------------");
         return(2);
      }
//---------------


Files:
proba.rar  10 kb
 
gince писал(а) >>

I don't know what the problem is with using the 12_VininI_HMA.mq4 indicator

Maybe it is the wrong closing condition or poorly described data from the indicator


For an EA it's better to use the simplest _HMA. And look for the inflection points in the EA itself. Or it can address to the zero buffer. And again, determine the pivot points in the Expert Advisor. Coloured lines are only for manual trading.

Files:
_hma.mq4  3 kb
 
Can anyone make an expert out of a turkey?
 
Please explain how to calculate the number of orders with a magic number...?
 
ArtY0m >> :
Please explain how to calculate number of orders with magic number...?

'Useful features from KimIV'.

//жжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжжж+
//|  Автор    : Ким Игорь В. aka KimIV,  http://www.kimiv.ru/                  |
//+----------------------------------------------------------------------------+
//|  Версия   : 19.02.2008                                                     |
//|  Описание : Возвращает количество позиций.                                 |
//+----------------------------------------------------------------------------+
//|  Параметры:                                                                |
//|    sy - наименование инструмента   (""   - любой символ,                   |
//|                                     NULL - текущий символ)                 |
//|    op - операция                   (-1   - любая позиция)                  |
//|    mn - MagicNumber                (-1   - любой магик)                    |
//+----------------------------------------------------------------------------+
int NumberOfPositions(string sy="", int op=-1, int mn=-1) {
  int i, k=OrdersTotal(), kp=0;

  if ( sy=="0") sy=Symbol();
  for ( i=0; i< k; i++)                                    {
    if (OrderSelect( i, SELECT_BY_POS, MODE_TRADES))      {
      if (OrderSymbol()== sy || sy=="")                   {
        if (OrderType()==OP_BUY || OrderType()==OP_SELL) {
          if ( op<0 || OrderType()== op)                   {
            if ( mn<0 || OrderMagicNumber()== mn) kp++;
          }}}}}
  return( kp);
}

For example,

if (NumberOfPositions(NULL,OP_BUY, Magic)>=4){/if open buy positions are greater than or equal to =4

 
Hello. I'm not sure i chose the right topic, but my question is: why can a profit not work in MT4? both build and ask go past the stop, the green beacon lights up, but the order does not work.
Reason: