Questions from a "dummy" - page 91

 
x100intraday:

I found what I was interested in here (I couldn't find anything like that in the help): http://zulman.googlecode.com/svn/trunk/MT5/Indicators/ColorCandles.mq5. Is it correct to combine in your indicator what I was asking about, or not really, but in this example it is practiced and works without problems.

Who said you can't do it that way? It is written in the help that you can copy to an indicator buffer. From another indicator.
 
Rosh:
Who said you can't do that? It says in the help that you can copy to the indicator buffer. From another indicator.
It's that simple. I had started copying errors using the above mentioned construction and a suspicion arose right there: maybe it is prohibited? When I looked through the reference for clarification, I found out that it contains many examples of SetIndexBuffer+CopyBuffer+INDICATOR_DATA, but together with INDICATOR_CALCULATIONS I have not found any example and decided that this may be a nuance that should be studied more thoroughly. But it turned out to be simpler.
 

Folks, I can't figure out why there are deals in the first case and no deals in the second?

void OnTick()
{
//double TIK = SymbolInfoDouble(_Symbol,SYMBOL_BID);
OPEN();
}
void OPEN()
  {
   MqlTradeRequest mrequest;                            
   MqlTradeResult mresult;                                   
      mrequest.action = TRADE_ACTION_DEAL;              
      mrequest.symbol = _Symbol;                      
      mrequest.volume = 1;    
      mrequest.price = SymbolInfoDouble(_Symbol,SYMBOL_BID);                   
      mrequest.sl = 0;                                 
      mrequest.tp = 0;                               
      mrequest.deviation = 5;                             
      mrequest.type= ORDER_TYPE_SELL;                   
      mrequest.type_filling = ORDER_FILLING_FOK;  
      OrderSend(mrequest,mresult);                       
  }

void OnTick()
{
double TIK = SymbolInfoDouble(_Symbol,SYMBOL_BID);
OPEN();
}
void OPEN()
  {
   MqlTradeRequest mrequest;                            
   MqlTradeResult mresult;                                   
      mrequest.action = TRADE_ACTION_DEAL;              
      mrequest.symbol = _Symbol;                      
      mrequest.volume = 1;    
      mrequest.price = SymbolInfoDouble(_Symbol,SYMBOL_BID);                   
      mrequest.sl = 0;                                 
      mrequest.tp = 0;                               
      mrequest.deviation = 5;                             
      mrequest.type= ORDER_TYPE_SELL;                   
      mrequest.type_filling = ORDER_FILLING_FOK;  
      OrderSend(mrequest,mresult);                       
  }
 

heh, did I ask you a question? try to copy the code and run it in the tester))) maybe my hands are wrong)) in fact, in theory, the line

double TIK = SymbolInfoDouble(_Symbol,SYMBOL_BID);

would not affect operability of Expert Advisor.

 
AUser:

heh, did I ask you a question? try to copy the code and run it in the tester))) maybe my hands are wrong)) in fact, in theory, the line

would not affect operability of Expert Advisor.

I agree, but it's better to provide details for reproduction. Write to Service Desk, please.
Общайтесь с разработчиками через Сервисдеск!
Общайтесь с разработчиками через Сервисдеск!
  • www.mql5.com
Ваше сообщение сразу станет доступно нашим отделам тестирования, технической поддержки и разработчикам торговой платформы.
 
AUser:

heh, did I ask you a question? try to copy the code and run it in the tester))) maybe my hands are wrong)) in fact, in theory, the line

would not affect operability of Expert Advisor.

MqlTradeRequest structure has more fields than you use, and therefore they contain rubbish.
The point is that mrequest variable is local (it's in stack) and presence or absence of other local
variables lying in the stack affect the content of uninitialized fields.
In one case, you are "lucky" and there appear values suitable for OrderSend, while in another case, you are not.

Use ZeroMemory to zero the structure completely.
 

If you look at platforms in general, is DLL importing a what? An exception available in MQL or the norm?

 
220Volt:

If you look at platforms in general, DLL imports are what? An exception available in MQL or the norm?

is this a compliment to MQL or don't you know how other platforms are?
 
sergeev:
is that a compliment to MQL or don't you know about other platforms?
It's an open-ended question, I'm wondering if it's worth transferring the basis of my developments to a DLL, for a flexible transition. I'm not happy with the prospect of rewriting everything every time
 
220Volt:
I'm wondering if I should move the basis of my work to the DLL, for a flexible transition.
Or are you worried about the DLL support being turned off?
Reason: