learning mql5

//----

much better......

when the count is >= 15 of the 17 possible signals, it returns current valid counts and bought it all or sold it all.......

this assures knowing that the timeframe is effectively maxed out......

paints a clearer picture and eliminates any possible confusion with gray......h
//------
View attachment 33701
MYMU25 1 buy jfatl 4

What is the value of the “4” here? I can see that there are four signals that are currently on their open bar.

Do you wait until there is only so much time left in the bar close to act on the signal, to avoid being faked out and the signal going away?

Also, are you buying a contract per signal, or do you only want to enter trades on the first “X” signals of a timeframe, to avoid getting in late?
 
Last edited:
MYMU25 1 buy jfatl 4

What is the value of the “4” here? I can see that there are four signals that are currently on their open bar.
//-----

another good catch........ yes....... MYMU25 1 buy jfatl 4 means there is a jfatl buy signal along with 3 others.......

the initiating signal will only last for 1 bar of that time frame it occurs...... just like a expert advisor buying when the macd crosses the 0 line...... it will place 1 trade..... after that the macd is above 0......

or say the price moves above the psar...... on that bar a expert might place a trade......

only new signals are blue or magenta....... the next bar they will be lime or red...... or yellow......
//------

so think about that...... if the 60, 240 and 1440 are all saying buy, wouldn't it better to watch the lower timeframes for buys.......

the possibility of fake outs do exist but they are of no concern to me......

on a 50k account my contract size is typically 1 micro...... if there are 7 signals on the 1 minute bar and 9 on the 5 minute bar, it's still 1.......

on a 150k account my contract size is typically 2 micros...... if there are 7 signals, it's still typically 2.......
//-----

as far as being late.......

how many times will the 1 minute psar signal occur during the day....... how many times will the 1 minute alma color change during the day......

how many times will the 5 minute psar signal occur during the day....... how many times will the 5 minute alma color change during the day......

how many times will the 15 minute psar signal occur during the day....... how many times will the 15 minute alma color change during the day......

you know those numbers.......

you know those numbers today for every single day next month......

why would i worry about being late for a trade on the 1 minute chart......

i'm more worried about that darn pig pushing my deer feeder over........ and i can tell you today where he will be next week.......h
//------

Screenshot 2025-07-22 185655.png
//--------

image000001.jpg

//--------

image000000.jpg
 
I may still be learning how to apply counts into financial markets, but I have learned other counts...

Like what comes after son #4 (and almost in the car on the way to the midwife)!... it would seem my average count for boys must at least be above 5

I suppose "Bought it all 16" on a 1hour could at least provide a bit of guidance on whether you are getting close to buying the top on the 1min...
 
I suppose "Bought it all 16" on a 1hour could at least provide a bit of guidance on whether you are getting close to buying the top on the 1min...
//------

i might not be clear what your saying....... but in a sense yes.......

all it really means is the 16 buy signals on the 60 chart have occurred..... so for example, if you know the average alma length, you could do the math..... if the alma has been lime for 5 hours, it might be time to take a break.......

roughly speaking, there is a predictable number of 1 minute signals in every 1440 minute bar...... same can be said for comparing all signals and all timeframes.......

take a chart in a 60 minute uptrend........ look at the 1 minute chart....... place a vertical line every time the stochastic(10,3,6) fell into the single digits......

now leaving the lines as is, move up to the 5...... 15....... 30, 60...... you can see the 1 minute signals density on each timeframe.....

i used to have peyton build 7 level signal pyramids with 1440 being the top ..... 1 minute being the bottom with 2x2 colored blocks.....

if the 1440 alma was lime, the top block would be lime........ she would count every buy signal that occurred during that day on lower time frames and build the pyramids...... there are more complex versions than just a single signal......

put those kids to work...... have them build those pyramids....... let them color the blocks......h
//------

Screenshot 2025-07-30 233733.png
//--------

Screenshot 2025-07-30 233900.png
//--------

Screenshot 2025-07-30 233930.png
//--------

Screenshot 2025-07-30 233956.png
 
roughly speaking, there is a predictable number of 1 minute signals in every 1440 minute bar...... same can be said for comparing all signals and all timeframes.......
//-----

the 1440, 240 and 60 often gives some protection to lower tfs.......

taking only signals/colors on lower tfs that agree with colors on high tfs seems more productive......

saves on band-aids also........h
//--------



MQL5:
        if(jfatl)
        {
        if((a[i] > a[i-1]))   colors[i] = 0.0;
 
        if((a[i] < a[i-1]))   colors[i] = 1.0;
        }
 
        if(fifty)
        {
        if((b[i] > b[i-1]))   colors[i] = 0.0;
 
        if((b[i] < b[i-1]))   colors[i] = 1.0;
        }
 
        if(hundred)
        {
        if((c[i] > c[i-1]))   colors[i] = 0.0;
 
        if((c[i] < c[i-1]))   colors[i] = 1.0;
        }
 
 
        if(hma)
        {
        if((e[i] > e[i-1]))   colors[i] = 0.0;
 
        if((e[i] < e[i-1]))   colors[i] = 1.0;
        }
 
 
        if(jjma)
        {
        if((f[i] > f[i-1]))   colors[i] = 0.0;
 
        if((f[i] < f[i-1]))   colors[i] = 1.0;
        } 
 
 
 
        if(alma)
        {
        if((g[i] > g[i-1]))   colors[i] = 0.0;
 
        if((g[i] < g[i-1]))   colors[i] = 1.0;
        }
 
 
        if(coppock)
        {
        if((h[i] > h[i-1]))   colors[i] = 0.0;
 
        if((h[i] < h[i-1]))   colors[i] = 1.0;
        }     
 
 
 
     }
//--- return value of prev_calculated for next call
   return(rates_total);
  }
//+------------------------------------------------------------------+

//-----

Screenshot 2025-08-02 021218.png
 
Last edited:
added obj_label label....... and objectcreate......

to show indicator which colors are based on........h

//-----

Screenshot 2025-08-02 163541.png

//------

MQL5:
//--- get handles
 
   ahandle  =  iCustom(_Symbol,Period(),"jfatl");                            
   bhandle  =  iMA(_Symbol,PERIOD_CURRENT,50,0,MODE_SMA,PRICE_CLOSE);
   chandle  =  iMA(_Symbol,PERIOD_CURRENT,100,0,MODE_SMA,PRICE_CLOSE);
   dhandle  =  iCustom(_Symbol,Period(),"vidyas");
   ehandle  =  iCustom(_Symbol,Period(),"hma",10,2.0);
   fhandle  =  iCustom(_Symbol,Period(),"jjma");
   ghandle  =  iCustom(_Symbol,Period(),"alma");
   hhandle  =  iCustom(_Symbol,Period(),"Coppock"); 
//   ihandle  =                                                                                
   jhandle  =  iCustom(_Symbol,Period(),"fatl");                                                                                 
   khandle  =  iCustom(_Symbol,Period(),"satl");                                                                              
   lhandle  =  iCustom(_Symbol,Period(),"TRIX",20);                                                                        
   mhandle  =  iCustom(_Symbol,Period(),"Spear");                                                                            
   nhandle  =  iTEMA(_Symbol,Period(),20,0,PRICE_CLOSE);                                                                            
   ohandle  =  iDEMA(_Symbol,Period(),20,0,PRICE_CLOSE);                                                                              
   phandle  =  iAO(_Symbol,Period());                                                                            
   qhandle  =  iStochastic(_Symbol,Period(), 10, 3, 6, MODE_SMA, STO_CLOSECLOSE);                                                                        
   rhandle  =  iCustom(_Symbol,Period(),"hma",89,2.0);  
//----
 
   string chosen = "";
 
   if(jfatl)       {chosen = "jfatl";}
   if(fifty)       {chosen = "fifty";} 
   if(hundred)     {chosen = "hundred";}
   if(vidyas)      {chosen = "vidyas";}  
   if(hma)         {chosen = "hma";}
   if(jjma)        {chosen = "jjma";}
   if(alma)        {chosen = "alma";}
   if(coppock)     {chosen = "coppock";}    
   if(fatl)        {chosen = "fatl";}    
   if(satl)        {chosen = "satl";} 
   if(trix)        {chosen = "trix";} 
   if(spearman)    {chosen = "spearman";} 
   if(tema)        {chosen = "tema";}
   if(dema)        {chosen = "dema";}    
   if(ao)          {chosen = "ao";} 
   if(stochastic)  {chosen = "stochastic";} 
   if(hma89)       {chosen = "hma89";}
//---- 
 
   Display("choice");  
   ObjectSetText("choice", chosen ,12,"Verdana", clrAqua);
 
 
  }

//-----

MQL5:
void ObjectSetText(const string name, const string text, const int size, string font = NULL, color clr = clrNONE)
{
    ObjectSetString(0,  name, OBJPROP_TEXT, text);
    ObjectSetInteger(0, name, OBJPROP_FONTSIZE, size);
    ObjectSetString(0,  name, OBJPROP_FONT, font);
    ObjectSetInteger(0, name, OBJPROP_COLOR, clr);
    ObjectSetInteger(0, name, OBJPROP_BACK, true);
}
 
 
 void Display(string name)
      {
      ObjectCreate(0,name, OBJ_LABEL,ChartWindowFind(ChartID(), shortname), 0, 0, 0);
      ObjectSetInteger(0,name, OBJPROP_CORNER, 0);
      ObjectSetInteger(0,name, OBJPROP_XDISTANCE, 50);
      ObjectSetInteger(0,name, OBJPROP_YDISTANCE, 50);
      }
 
Last edited:
thanks to enivid, .....

now feel comfortable saying any reasonable indicator can be made into a multi timeframe indicator in less than 1 minute......

and 2 indicators might be able to contain them all ....

one for indicators applied to main chart window and a second for those needing their own window.......h
//--------

MQL5:
//--- get a user selected indicator for "ahandle".......   this allows mtf conversion for all.......
 
   if(jfatl)       ahandle  =  iCustom(_Symbol,timeframe,"jfatl");                          
   if(fifty)       ahandle  =  iMA(_Symbol,timeframe,50,0,MODE_SMA,PRICE_CLOSE);
   if(hundred)     ahandle  =  iMA(_Symbol,timeframe,100,0,MODE_SMA,PRICE_CLOSE);
   if(vidyas)      ahandle  =  iCustom(_Symbol,timeframe,"vidyas");
   if(hma)         ahandle  =  iCustom(_Symbol,timeframe,"hma",10,2.0);
   if(jjma)        ahandle  =  iCustom(_Symbol,timeframe,"jjma");
   if(alma)        ahandle  =  iCustom(_Symbol,timeframe,"alma");            
   if(coppock)     ahandle  =  iCustom(_Symbol,timeframe,"Coppock");// needs to be in a second window version       
//   ihandle  =                                                                              
   if(fatl)        ahandle  =  iCustom(_Symbol,timeframe,"fatl");                                                                                
   if(satl)        ahandle  =  iCustom(_Symbol,timeframe,"satl");                                                                            
   if(trix)        ahandle  =  iCustom(_Symbol,timeframe,"TRIX",20);                                                                      
   if(spearman)    ahandle  =  iCustom(_Symbol,timeframe,"Spear");                  // needs to be in a second window version                                                               
   if(tema)        ahandle  =  iTEMA(_Symbol,timeframe,20,0,PRICE_CLOSE);                                                                          
   if(dema)        ahandle  =  iDEMA(_Symbol,timeframe,20,0,PRICE_CLOSE);                                                                            
   if(ao)          ahandle  =  iAO(_Symbol,timeframe);                   // needs to be in a second window version                                                              
   if(stochastic)  ahandle  =  iStochastic(_Symbol,timeframe, 10, 3, 6, MODE_SMA, STO_CLOSECLOSE);  // needs to be in a second window version                                                
   if(hma89)       ahandle  =  iCustom(_Symbol,timeframe,"hma",89,2.0);
//----

//-------

Screenshot 2025-08-03 130317.png

//-----

Screenshot 2025-08-03 131654.png
 
Last edited:
  • 👍
Reactions: Enivid
august to do list.......

a... decide on best manner to weight timeframes......

b.... decide on best manner to weight each indicators current condition by time frame......

c.... decide on best manner to sum the total time weighted results......

//---------------------------------------------------

  • The relative conceptual importance of indicators: is indicator A more, less, or equally important to indicator B? chapter 11 weighting.......
//-------

Before, we agreed that an indicator is a number....... calculate metrics......

//--------

//-------
a equal weight approach....... where each timeframes weight was 1...... if alma is rising on all 7 timeframes the value would be 7....... if 5 were rising and 2 falling, value would be 5....... if 7 were falling the value would be -7....

hard to see that working...... surely the 30 minute chart should carry more weight than the 1 minute......h
 
Last edited: