Coding help - page 754

 
1225113:
thanks for your opinion. there is a demand for more, could this indicator (attached) can be made in the EA close all open orders and pending orders'?

If you mean can an indicator handle orders, it can not ...

If you mean can the values of that indicator be used for that, then, yes they can. You must use some logic to use values from your indicator and then to incorporate that logic in your EA. But just piling indicators is not going to help. Define your strict rules and then use those rules.


And the 3rd: that indicator repaints. If you try to use it from the EA (any EA) you shall soon find out that trying to use that indicator from the EA for any kind of signals is useless
 

Could an alert be added to these two indicators please?

Thanks

TEAMTRADER

 

hi,

I used mt5. 

I need a function that display a incremental comment,  using FIFO 

 

showcomment ("EA started");

showcomment ("buy at xxxx") ;

showcomment ("sell close at xxxx") ; 

etc.etc..etc..

showcomment ("EA Finished at 23:00");

 
baraozemo:

hi,

I used mt5. 

I need a function that display a incremental comment,  using FIFO 

 

showcomment ("EA started");

showcomment ("buy at xxxx") ;

showcomment ("sell close at xxxx") ; 

etc.etc..etc..

showcomment ("EA Finished at 23:00");

Try something like this :

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment) for (int i=0; i<linesCount-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                             _commentLines[MathMin(linesCount,_maxLinesInComment-1)] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}
 
mladen:

Try something like this :

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment) for (int i=0; i<linesCount-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                             _commentLines[MathMin(linesCount,_maxLinesInComment-1)] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}

Mladen thanks for reply.

 

After filled 20 lines, the code is NOT "scrolling up" the comments...  
the oldest line comment should be delete  to enter the new

 
baraozemo:

Mladen thanks for reply.

 

After filled 20 lines, the code is NOT "scrolling up" the comments...  
the oldest line comment should be delete  to enter the new

Try this :

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment-1) for (int i=0; i<_maxLinesInComment-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                                       _commentLines[linesCount] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}
 
tks , works perfect
 
mladen:

Try this :

#define _maxLinesInComment 20
string _commentLines[_maxLinesInComment];
void incrementalComment(string line)
{
   static int linesCount=0;
      if (linesCount==_maxLinesInComment-1) for (int i=0; i<_maxLinesInComment-1; i++) _commentLines[i]=_commentLines[i+1];
                                                                                       _commentLines[linesCount] = line; linesCount=MathMin(linesCount+1,_maxLinesInComment-1);
   string comment = ""; for (int i=0; i<linesCount; i++) comment += _commentLines[i]+"\n";
   Comment(comment);                                                    
}

Dear @mladen,

If possible, can you add an alarm to attached trend indicator when all boxes are green or red? 

 
mladen:

If you mean can an indicator handle orders, it can not ...

If you mean can the values of that indicator be used for that, then, yes they can. You must use some logic to use values from your indicator and then to incorporate that logic in your EA. But just piling indicators is not going to help. Define your strict rules and then use those rules.


And the 3rd: that indicator repaints. If you try to use it from the EA (any EA) you shall soon find out that trying to use that indicator from the EA for any kind of signals is useless
Dear mladen.
I strongly agree with your opinion if applied to other EA for the signal, but I only use for manual trading, while close orders to wear EA ... I need HH or LL to close order whatever my idea is right? ... or maybe EA you got better as I mean to recommend to me, can you show me ?...

Thank you for your attention
 
1225113:
Dear mladen.
I strongly agree with your opinion if applied to other EA for the signal, but I only use for manual trading, while close orders to wear EA ... I need HH or LL to close order whatever my idea is right? ... or maybe EA you got better as I mean to recommend to me, can you show me ?...

Thank you for your attention

Your original question was :

1225113:
thanks for your opinion. there is a demand for more, could this indicator (attached) can be made in the EA close all open orders and pending orders'?
The answer was regarding that. In any case, if you are trading manually, then there is no purpose of changing anything (not even the repainting indicator)
Reason: