[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 533

 
inttehn писал(а) >>
Guys, please help.
Is it true that the exchange rate depends entirely on the volume of bids received.
Simply, if this is true, then knowing the volume ratio and knowing their sum (total volume of bids) you can ignore the price, because it can be unambiguously represented as a function equal to the ratio of the corresponding volume functions for buying one and the other currency.


This is the worst bourgeois secret of all.

 

Gentlemen, programmers, please help me make the EA work only in specified

For example: from 9-00 to 13-30 and from 17-00 to 22-30.

The problem is that I know MQL4 very distantly and very superficially.

If you have an Expert Advisor, it generates signals for opening and placing orders according to its own algorithm during a day.

But we have to make it form and execute these signals only at a certain time, for instance, in a week.

The bottom line shows you the principle, what I am talking about:)

extern int H = 1; //hour

extern int H = 1; //minute.

extern double Lots = 0.1; //lot.

extern int SL = 15; //stop

extern int TP = 100; //take

int arparp

int aprvp

int aprvar

//which variables to set?


int start()

{

if ( what should I add here, the main code will be executed only during daytime periods from 9-00 to

13-30 and 17-00-22-30? )

return(0);


if ( condition that caused the EA to execute its actions)

{

EA body

}

return(0);

}

Thank you!

 
inttehn >>:
Ребят, помогите пожалуйста.
Верно ли, что курс валюты полностью зависит от объёма поступивших заявок. Т.е. если P1 - условная цена одной валюты, а P2- условная цена второй, то P1*V1=P2*V2, где V1 и V2- объёмы поступивших заявок на покупку первой и второй валюты соответственно. Курс в этом случае будет равен P1/P1(курс)=V2/V1. Просто если это так, то зная отношения объёмов и зная их сумму (общий объём заявок) можно не принимать во внимание цену, т.к. её можно однозначно представить как функцию равную отношению соответствующих функций объёмов на покупку одной и второй валюты. Эти объёмы предсказываются гораздо легче, чем цена, т.к. характеризуются только экономическими потребностями определённых субъектов. Вообще это должно быть верно по теории (основываясь на платёжный баланс стран и международную торговлю), но так ли это на самом деле? Может кто-нибудь над этим задумывался?

Everything is true, but you just have to keep in mind that a quote is not exactly what you have called "notional currency price" and what is derived from the ratio you mentioned, but the price of the last trade on a given pair. As for the most important bourgeois secret - I agree with the previous speaker 100%.

 
bizon3d >>:

Господа, програмисты, помогите пожалуйста заставить советник работать только в установленные

периоды суток к примеру: с 9-00 по 13-30 и с 17-00 по 22-30.


if ((Hour()>=9&&(Hour()<13||Hour()==13&&Minute()<=30))||(Hour()>=17&&(Hour()<22||Hour()==22&&Minute()<=30)))
{
   //TODO
}
 
Hi all! I apologise at once for writing maybe off-topic, it's my first time here, but here's a question. I want to ask you if someone can fix the following problem. I want to say that I have never tried to change the indicator's color. The colour is OK...Very annoying...If you can fix it, please, as I have no knowledge of these things at all.... Thanks in advance...
Files:
macd_line.rar  3 kb
 
And another question. I cannot find an indicator that consists of a MACD histogram (like in the attachment ind_OsMAColored_v1, i.e. without extra frills, just 4 colour and width variants) and MACD line indicator as in the previous post (I attached it again), so that the null lines coincide in the histogram and lines. When you overlap these the null lines don't coincide. Indicators, that I have found, always either something is added (crossing moments are marked with vertical lines, divergence is drawn, Elder's impulse system is added, etc.), or it does not react on parameter changes or something else..... Is it possible to somehow merge exactly these 2 indicators, where from settings thickness of lines and colour as they have. Maybe someone has a ready-made ... If I'm writing in the wrong place please tell me where to write....Thank you
Files:
 

So we've decided on a price and we want to buy...

Euro/dollar

Price

1.3233

To buy optimally, we buy like this...

buy (1.3230, slipage 3) Right?

 


Why do indicators kill the terminal completely
this is an example of the indicator #MFT_Trendline.mq4


Number of bars in the history 5 000 and on the screen 2 000

Fibo fans also kill the terminal completely

Files:
 
Hello.
How do I show the name and property of the OBJ_HLINE object? For example as percentages on Fibonacci levels.
 
Hello.
in the code below does not trigger an opening. If a new bar opens above the moving average, it opens Shell, if it opens below, it opens Buy. Close when moving average is reached, + stoploss + trailing stop. Help with code and explanation of what I did wrong. Thanks in advance!!!
#include <b-Lots.mqh>
extern double TrailingStop = 30;
extern double Sploss = 15;
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
int start() {
   double HA_up,HA_dw;
   double MA_H0,MA_H1,MA_L0,MA_L1,MA_0,MA_1;
   int i, cnt, ticket, total;
   bool flag=true;

   if(Bars<100) {
      Print("bars less than 100");
      return(0); 
   }
// Проверяем стоит ли открываться
   
   cnt=OrdersHistoryTotal()-1;
   for(i=cnt;i>=0;i--) {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_HISTORY )) continue;
      if(OrderOpenTime()>=Time[0]) { // Time[0] - если позиция открывается на нулевом баре текущего символа
         flag=false;
         break;
      }
   }
   cnt=OrdersTotal()-1;
   for(i=cnt;i>=0;i--) {
      if(!OrderSelect(i, SELECT_BY_POS, MODE_TRADES)) continue;
      if(OrderOpenTime()>=Time[0]) { // Time[0] - если позиция открывается на нулевом баре текущего символа
         flag=false;
         break;
      }
   }
   if(!flag) return(0); 
//-----------------------------------------------

   MA_0=iMA(0,0,3,0,MODE_EMA,PRICE_MEDIAN,0);
   MA_1=iMA(0,0,3,0,MODE_EMA,PRICE_MEDIAN,1);


//задали все данные 

   total=OrdersTotal();
   if(total<1) 
     {
      // Проверка свободной маржи
      if(AccountFreeMargin()<(1000*Lots))
        {
         Print("We have no money. Free Margin = ", AccountFreeMargin());
         return(0);  
        }
      // Условие открытие позиции BUY
      if(Open[0]<MA_0)
        {
         Lots=GetSizeLot();
         ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,5,Bid-Sploss*Point,0,"",16384,0,Green);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("BUY order opened : ",OrderOpenPrice());
           }
         else Print("Error opening BUY order : ",GetLastError()); 
         return(0); 
        }
      // Условие открытие позиции SELL
      if(Open[0]>MA_0)
        {
         Lots=GetSizeLot();
         ticket=OrderSend(Symbol(),OP_SELL,Lots,Bid,5,Ask+Sploss*Point,0,"",16384,0,Red);
         if(ticket>0)
           {
            if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES)) Print("SELL order opened : ",OrderOpenPrice());
           }
         else Print("Error opening SELL order : ",GetLastError()); 
         return(0); 
        }
      return(0);
     }
    
   for(cnt=0;cnt<total;cnt++)
     {
      OrderSelect(cnt, SELECT_BY_POS, MODE_TRADES);
      if(OrderType()<=OP_SELL &&   
         OrderSymbol()==Symbol())  
        {
         if(OrderType()==OP_BUY)   // длинная позиция открыта
           {
           if(NormalizeDouble (MathAbs(MA_0-Bid),Digits)<Point)
                {
                 OrderClose(OrderTicket(),OrderLots(),Bid,3,Violet); 
                 return(0); 
                }
            // трейлинг-стоп для длинной позиции
            if(TrailingStop>0)  
              {                 
               if(Bid-OrderOpenPrice()>Point*TrailingStop)
                 {
                  if(OrderStopLoss()<Bid-Point*TrailingStop)
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Bid-Point*TrailingStop,OrderTakeProfit(),0,Green);
                     return(0);
                    }
                 }
              }
           }
         else 
           {
           if(NormalizeDouble (MathAbs(MA_0-Ask),Digits)<Point)
              {
               OrderClose(OrderTicket(),OrderLots(),Ask,3,Violet); 
               return(0); 
              }
            // трейлинг-стоп для короткой позиции
            if(TrailingStop>0)  
              {                 
               if((OrderOpenPrice()-Ask)>(Point*TrailingStop))
                 {
                  if((OrderStopLoss()>(Ask+Point*TrailingStop)) || (OrderStopLoss()==0))
                    {
                     OrderModify(OrderTicket(),OrderOpenPrice(),Ask+Point*TrailingStop,OrderTakeProfit(),0,Red);
                     return(0);
                    }
                 }
              }
           }
        }
     }
   return(0);
  }

.
Reason: