Questions from Beginners MQL5 MT5 MetaTrader 5 - page 327

 
I have the following question. Why can't real traders use signals from demo accounts? If this strategy suits me, why such a restriction? And.afterwards,why can't I try free signals from a real account on my demo account?
 
366704:
I have the following question. Why can't real traders use signals from demo accounts? If this strategy suits me, why such a restriction? And.after that, why can't I try free signals from the real account on my demo account?
These are the rules of the Signals service.
 

People, can someone tell me why my Expert Advisor does not exhibit StopLoss, otherwise it works correctly: both buy and sell?

if(fast_ma[1]<slow_ma[1] && fast_ma[0]>slow_ma[0])
     {
      if(m_Position.Select(_Symbol))
        {
         if(m_Position.PositionType()==POSITION_TYPE_SELL) m_Trade.PositionClose(_Symbol);
         if(m_Position.PositionType()==POSITION_TYPE_BUY) return;
        }    
      double sl_long = m_Position.PriceCurrent()-0.0002; 
      m_Trade.Buy(lot,_Symbol,0,sl_long);                       
     }   
   if(fast_ma[1]>slow_ma[1] && fast_ma[0]<slow_ma[0])       
     {
      if(m_Position.Select(_Symbol))                        
        {
         if(m_Position.PositionType()==POSITION_TYPE_BUY) m_Trade.PositionClose(_Symbol);
         if(m_Position.PositionType()==POSITION_TYPE_SELL) return;
        }     
      double sl_short = m_Position.PriceCurrent()+0.0002; 
      m_Trade.Sell(lot,_Symbol,0,sl_short);                  
     }
 
GreenPeace:

Folks, can someone tell me why my EA does not exhibit StopLoss, otherwise it works correctly: both buy and sell?

It would be very strange if it were to put two pips for a four-digit stop from the current price. Such a stop is unlikely to exceed the spread, i.e. it should work immediately after opening the position.
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
Документация по MQL5: Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров
  • www.mql5.com
Стандартные константы, перечисления и структуры / Торговые константы / Свойства ордеров - справочник по языку алгоритмического/автоматического трейдинга для MetaTrader 5
 
Reshetov:
It would be very strange if it were to put two pips for a four digits from the current price. Such a stop is unlikely to go outside the spread, i.e. should trigger immediately after opening the position.

I tested this EA again and it stopped making trades altogether. Here's a working part of the program that buys and sells, but I can't get it to place stops when placing an order...

if(fast_ma[1]<slow_ma[1] && fast_ma[0]>slow_ma[0])
     {
      if(m_Position.Select(_Symbol))
        {
         if(m_Position.PositionType()==POSITION_TYPE_SELL) m_Trade.PositionClose(_Symbol);
         if(m_Position.PositionType()==POSITION_TYPE_BUY) return;
        }       
      m_Trade.Buy(lot,_Symbol);                             
     }    
   if(fast_ma[1]>slow_ma[1] && fast_ma[0]<slow_ma[0])        
     {
      if(m_Position.Select(_Symbol))                         
        {
         if(m_Position.PositionType()==POSITION_TYPE_BUY) m_Trade.PositionClose(_Symbol);
         if(m_Position.PositionType()==POSITION_TYPE_SELL) return;
        }        
      m_Trade.Sell(lot,_Symbol);                        
     }
 

Hello! If I want to compare the latest ticker prices in the "Voting" block that price will grow. like this

m_symbol.Bid(idx)> m_symbol.bid(idx+1) &&m_symbol.Bid(idx+1)> m_symbol.bid(idx+2) error " wrong parameters count"when compiling

Please advise at least which way to go, or where this was discussed. thanks!

 
newnek:

Hello! If I want to compare the latest ticker prices in the "Voting" block that price will grow. like this

m_symbol.Bid(idx)> m_symbol.bid(idx+1) &&m_symbol.Bid(idx+1)> m_symbol.bid(idx+2) error " wrong parameters count"when compiling

Please advise at least which way to go, or where this was discussed. thanks!

You should move towards a careful reading of documentation. Why the hell did you think that Bid() can have arguments?
 
Reshetov:
The way to proceed is to read the documentation carefully. Why the hell would you think that Bid() can have arguments?
Can you tell me which is better to use?
 
newnek:
Can you tell me which is better to use?
All right, you got it. Use a printing press.
 

I bought an EA, how do I copy it to another computer?

the description does include such an option.

Reason: