MQ4 Code Works

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
hey tc..... posting this here because pm's are tedious to read thru.....

in some video, not sure if i uploaded it, i mentioned that if someone would open any common chart....... give me only the timeframe, the number of bars and a common indicator, i could tell them the number of signals and average length within reason..... without even knowing the pair.....

you probably soon know how true that is......
//------

i still can not find that exact red 14 code...... can't even remember the name for sure......

but here is my normal manner..... everything is placed in multi dimensional arrays to keep things orderly.... the end result is in a single multi dimensional array, every pair, every time frame, every signal, and much much more......

the thought behind all this was , regardless of pair,,,,, if the jjma has been lime for 4 days, the jfatl has been lime for 5 days and the alma has been lime for 6 days, do i really want to be buying......

if this type idea appeals to you i'll keep searching for that code and we can expand it here...... it might take me a while...... lot of laptops to look thru.....h

//-------
 

Attachments

  • tc.mq4
    2.9 KB · Views: 28
  • tc.ex4
    4.7 KB · Views: 9
  • 👍
Reactions: Enivid

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Thank you for the info and the code! Out of curiosity, was this a real script, or just an idea to get the framework? After watching your Dashboard series on YouTube, I thought you just computed data in different columns to reflect different pairs and TFs. Did you use this script, actually storing the data into the multi-dimensional array, for another purpose or form of analysis, or did you display in dashboard form like with your alligator demo?
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
hey tc..... it was just an idea on framework....

true scripts are my preferred method because they only hit the cpu 1 time and everything is done.... indicators and expert advisors can also be used if the load is not to much..... in their case i will usually insert the line,

if(bars != Bars) along with

bars = Bars; after all is done so it will run once per bar.....
//-----

the buffers and all you were talkin about will be a simple matter before long..... the goal is to be able to write the indicator in your mind..... as strange as that might seem, it's not far fetched...... think of all the singers , musicians , carpenters, concrete workers, on and on might have paper laying around somewhere, but they primarily work out in their minds...... code is no different.....

try to keep the code simple so that you can easily read thru it..... fewest letters/characters as possible.... keep the buffer names meaningful, like

up[];
dn[];
wait[];

make it a goal to write 1 meaningful indicator a day..... you can write hundreds a day, but 1 meaningful indicator with a useful purpose is better....h
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
some more thoughts.....

if writing indicators, create your own folder in the navigator..... like bill williams indicators are in his folder, volumes in the volumes folder.....

yours can be in the tc folder..... otherwise it will be come a nightmare..... name things clearly and precede them with a prefix, like tc......

each week chose something different, such as make this week histograms..... write/edit 7 new ones...... as examples, look at the code i have commented out.....

in 30 seconds you can combine them all into a single selectable indicator, but for now make each individual.....

above all, there is no call to impress so keep it simple..... the goal is to write it in your mind first...... there are side effects to that ability that will serve you later......h
//-----

nzdusd-d1-oanda-division1-tc.png
 

Attachments

  • tc tsr histogram.mq4
    2.8 KB · Views: 12
  • tc wpr histogram.ex4
    7 KB · Views: 8
  • 👍
Reactions: TradeChaser

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Awesome insights and thanks for sharing! I will do just that. I have a major weakness of trying to run before I walk (when I should probably be crawling).

I will work on doing just that!
 

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Speaking of the devil... This may be too much, but will be my first project. It is an amalgamation of all of the WPR rankings across all pairs. If you select just those pairs that cross over a chart, perhaps it gives a hint of what is to come. Of course, I have not forward traded this, and as you can see, it appears to be some signals that create chop. But with the correct filter, maybe those can be avoided also.

1645204231084.png
Post automatically merged:

You will see why I enjoy Thinkscript in learning to code indicators lol. Below is the thinkscript for the above. It is very intuitive, and should read like a Pseudo Code for what I will try to create.

Basically, it iterates all of the WPRs of each pair, and averages them. Then it ranks by strength. However, like the image above, you can choose to just show the plots for the pair on screen to show where the shifts in momentum can happen.

Code:
declare lower;

def len1 = 7;
def timeframe = AggregationPeriod.day;

def GBP1 = (close("GBP/USD", period =  timeframe) - Highest(high("GBP/USD", period = timeframe), len1)) / ((Highest(high("GBP/USD", period = timeframe), len1)) - Lowest(low("GBP/USD", period = timeframe), len1))*100;
def GBP2 = (close("GBP/JPY", period =  timeframe) - Highest(high("GBP/JPY", period = timeframe), len1)) / ((Highest(high("GBP/JPY", period = timeframe), len1)) - Lowest(low("GBP/JPY", period = timeframe), len1))*100;
def GBP3 = (close("GBP/CAD", period =  timeframe) - Highest(high("GBP/CAD", period = timeframe), len1)) / ((Highest(high("GBP/CAD", period = timeframe), len1)) - Lowest(low("GBP/CAD", period = timeframe), len1))*100;
def GBP4 = (close("GBP/AUD", period =  timeframe) - Highest(high("GBP/AUD", period = timeframe), len1)) / ((Highest(high("GBP/AUD", period = timeframe), len1)) - Lowest(low("GBP/AUD", period = timeframe), len1))*100;
def GBP5 = -100 - ((Highest(high("EUR/GBP", period = timeframe), len1) - close("EUR/GBP", period =  timeframe)) / (Lowest(low("EUR/GBP", period = timeframe), len1) - Highest(high("EUR/GBP", period = timeframe), len1))) * 100;

plot gbp_avg = (GBP1 + GBP2 + GBP3 + GBP4 + GBP5) / 5;
gbp_avg.AssignValueColor(color.Blue);
addlabel(yes, CONCAT("GBP", concat(" ", gbp_avg)), color.Blue);

def eur1 = (Highest(high("EUR/USD", period = timeframe)) - close("EUR/USD", period = timeframe)) / (Highest(high("EUR/USD", period = timeframe)) - Lowest(low("EUR/USD", period = timeframe), len1)) * (-100);
def EUR2 = (Highest(high("EUR/JPY", period = timeframe), len1) - close("EUR/JPY", period = timeframe)) / ((Highest(high("EUR/JPY", period = timeframe), len1)) - Lowest(low("EUR/JPY", period = timeframe), len1))*(-100);
def EUR3 = (Highest(high("EUR/CAD", period = timeframe), len1) - close("EUR/CAD", period =  timeframe)) / ((Highest(high("EUR/CAD", period = timeframe), len1)) - Lowest(low("EUR/CAD", period = timeframe), len1))*(-100);
def EUR4 = (Highest(high("EUR/AUD", period = timeframe), len1) - close("EUR/AUD", period =  timeframe)) / ((Highest(high("EUR/AUD", period = timeframe), len1)) - Lowest(low("EUR/AUD", period = timeframe), len1))*(-100);
def EUR5 = (Highest(high("EUR/GBP", period = timeframe), len1) - close("EUR/GBP", period = timeframe)) /  ((Highest(high("EUR/GBP", period = timeframe), len1)) - Lowest(low("EUR/GBP", period = timeframe), len1)) * (-100);
plot eur_avg = (eur1 + eur2 + eur3 + eur4 + eur5) / 5;
eur_avg.AssignValueColor(color.green);
addlabel(yes, CONCAT("EUR", concat(" ", eur_avg)), color.green);

def usd1 = -100 + ((close("EUR/USD", period =  timeframe) - Highest(high("EUR/USD", period = timeframe), len1)) / (Lowest(low("EUR/USD", period = timeframe), len1) - (Highest(high("EUR/USD", period = timeframe), len1)))*100);
def usd2 = (close("USD/JPY", period =  timeframe) - Highest(high("USD/JPY", period = timeframe), len1)) / ((Highest(high("USD/JPY", period = timeframe), len1)) - Lowest(low("USD/JPY", period = timeframe), len1))*100;
def usd3 = (close("USD/CAD", period =  timeframe) - Highest(high("USD/CAD", period = timeframe), len1)) / ((Highest(high("USD/CAD", period = timeframe), len1)) - Lowest(low("USD/CAD", period = timeframe), len1))*100;
def usd4 = -100 + (close("AUD/USD", period =  timeframe) - Highest(high("AUD/USD", period = timeframe), len1)) / (Lowest(low("AUD/USD", period = timeframe), len1) - (Highest(high("AUD/USD", period = timeframe), len1)))*100;
def usd5 = -100 + (((close("GBP/USD", period = timeframe) -((Highest(high("GBP/USD", period = timeframe), len1)))) / (Lowest(low("GBP/USD", period = timeframe), len1) - (Highest(high("GBP/USD", period = timeframe), len1)))) * 100);
plot usd_avg = (usd1 + usd2 + usd3 + usd4 + usd5) / 5;
usd_avg.AssignValueColor(color.red);
addlabel(yes, CONCAT("USD", concat(" ", usd_avg)), color.red);


def aud1 = (close("AUD/USD", period =  timeframe) - Highest(high("AUD/USD", period = timeframe), len1)) / ((Highest(high("AUD/USD", period = timeframe), len1)) - Lowest(low("AUD/USD", period = timeframe), len1))*100;
def aud2 = (close("AUD/JPY", period =  timeframe) - Highest(high("AUD/JPY", period = timeframe), len1)) / ((Highest(high("AUD/JPY", period = timeframe), len1)) - Lowest(low("AUD/JPY", period = timeframe), len1))*100;
def aud3 = (close("AUD/CAD", period =  timeframe) - Highest(high("AUD/CAD", period = timeframe), len1)) / ((Highest(high("AUD/CAD", period = timeframe), len1)) - Lowest(low("AUD/CAD", period = timeframe), len1))*100;
def aud4 = -100 + (((Highest(high("EUR/AUD", period = timeframe), len1))) - close("EUR/AUD", period = timeframe)) / (Lowest(low("EUR/AUD", period = timeframe), len1) - (Highest(high("EUR/AUD", period = timeframe), len1))) * (-100);
def aud5 =-100 + (((Highest(high("GBP/AUD", period = timeframe), len1))) - close("GBP/AUD", period = timeframe)) / (Lowest(low("GBP/AUD", period = timeframe), len1) - (Highest(high("GBP/AUD", period = timeframe), len1))) * (-100);
plot aud_avg = (aud1 + aud2 + aud3 + aud4 + aud5) / 5;
aud_avg.AssignValueColor(color.PLUM);
addlabel(yes, CONCAT("AUD", concat(" ", aud_avg)), color.plum);


def cad1 = -100 + (((Highest(high("GBP/CAD", period = timeframe), len1))) - close("GBP/CAD", period = timeframe)) / (Lowest(low("GBP/CAD", period = timeframe), len1) - (Highest(high("GBP/CAD", period = timeframe), len1))) * (-100);
def cad2 = (close("CAD/JPY", period =  timeframe) - Highest(high("CAD/JPY", period = timeframe), len1)) / ((Highest(high("CAD/JPY", period = timeframe), len1)) - Lowest(low("CAD/JPY", period = timeframe), len1))*100;
def cad3 = -100 + (((Highest(high("AUD/CAD", period = timeframe), len1))) - close("AUD/CAD", period = timeframe)) / (Lowest(low("AUD/CAD", period = timeframe), len1) - (Highest(high("AUD/CAD", period = timeframe), len1))) * (-100);
def cad4 = -100 + (((Highest(high("EUR/CAD", period = timeframe), len1))) - close("EUR/CAD", period = timeframe)) / (Lowest(low("EUR/CAD", period = timeframe), len1) - (Highest(high("EUR/CAD", period = timeframe), len1))) * (-100);
def cad5 =-100 + (((Highest(high("USD/CAD", period = timeframe), len1))) - close("USD/CAD", period = timeframe)) / (Lowest(low("USD/CAD", period = timeframe), len1) - (Highest(high("USD/CAD", period = timeframe), len1))) * (-100);
plot cad_avg = (cad1 + cad2 + cad3 + cad4 + cad5) / 5;
cad_avg.AssignValueColor(color.daRK_ORANGE);
addlabel(yes, CONCAT("CAD", concat(" ", cad_avg)), color.darK_ORANGE);

def jpy1 = -100 + (((Highest(high("GBP/JPY", period = timeframe), len1))) - close("GBP/JPY", period = timeframe)) / (Lowest(low("GBP/JPY", period = timeframe), len1) - (Highest(high("GBP/JPY", period = timeframe), len1))) * (-100);
def jpy2 = -100 + (((Highest(high("USD/JPY", period = timeframe), len1))) - close("USD/JPY", period = timeframe)) / (Lowest(low("USD/JPY", period = timeframe), len1) - (Highest(high("USD/JPY", period = timeframe), len1))) * (-100);
def jpy3 = -100 + (((Highest(high("AUD/JPY", period = timeframe), len1))) - close("AUD/JPY", period = timeframe)) / (Lowest(low("AUD/JPY", period = timeframe), len1) - (Highest(high("AUD/JPY", period = timeframe), len1))) * (-100);
def jpy4 = -100 + (((Highest(high("EUR/JPY", period = timeframe), len1))) - close("EUR/JPY", period = timeframe)) / (Lowest(low("EUR/JPY", period = timeframe), len1) - (Highest(high("EUR/JPY", period = timeframe), len1))) * (-100);
def jpy5 = -100 + (((Highest(high("CAD/JPY", period = timeframe), len1))) - close("CAD/JPY", period = timeframe)) / (Lowest(low("CAD/JPY", period = timeframe), len1) - (Highest(high("CAD/JPY", period = timeframe), len1))) * (-100);
plot jpy_avg = (jpy1 + jpy2 + jpy3 + jpy4 + jpy5) / 5;
jpy_avg.AssignValueColor(color.YELLOW);
addlabel(yes, CONCAT("JPY", concat(" ", jpy_avg)), color.YELLOW);
 

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Here I am with the MT4! I am having trouble with two things. One I don't know is possible, the other I know it is.

First, is there any way to get this oscillator on the Main Chart window? The currency cross would be neat to see at the same time over the candle sticks. I have tried changing the #property, but to no avail. Changing to chart_window simply shows nothing.

Secondly, I cannot get the chart to draw. I copied your code from 3 piggies, and tried to modify it as shown on lines 133 and 147. Basically, I am sure you can see where I am trying to cross the arrays and capture this with a vertical line.

Can you see where I am missing the boat?

I attached two versions of my indicator.

The WPR_CurrencyCross is more or less final. You pick the timeframe from an ENUM list. This will set the iBarShift and period for you. Next, you pick the two pairs you want to compare. This will pit the two currencies (and their average strengths) against each other. This is the one I want to either overlay on the candles, or to draw arrows, lines, (or even create a line chart that simply changes colors). Something to show the signal.

The WPR_Test is the full version of the thinkscript above. That is to say, its currency strength Indicator. It is missing a color code so you know what label is what without looking at the code, but the concept is visible.
Post automatically merged:

1645256696901.png
 

Attachments

  • WPR_TEST.mq4
    8.2 KB · Views: 7
  • WPR_CurrencyCross.mq4
    9 KB · Views: 12

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
Here I am with the MT4! I am having trouble with two things. One I don't know is possible, the other I know it is.
//-----

hey tc..... glad to see it.... will look at your code.....

there was a time when people would kick around ideas on forex forums..... now days not so much.....

you can expand your idea to include most any indicator.... it can be expressed as lines, histograms, arrows, wingdings and so on....

often as not, a single indicator can be written as a one-does-all type..... where it will plot any of a entire group of sub indicators if selected....

in the spirt of kicking the idea around, look also into IMA on array..... this gives the smoothing effect,,,,,

the code below would be mq4's version of your thinkscript......

//----

Code:
     jpy[i] = (-(iWPR("EURJPY",0,7,i)      + iWPR("USDJPY",0,7,i) + iWPR("CADJPY",0,7,i) + iWPR("GBPJPY",0,7,i) + iWPR("AUDJPY",0,7,i)) / 5) - 100 ;
     gbp[i] = (-(iWPR("EURGBP",0,7,i)+100) + iWPR("GBPUSD",0,7,i) + iWPR("GBPCAD",0,7,i) + iWPR("GBPJPY",0,7,i) + iWPR("GBPAUD",0,7,i)) / 5 ;
//----

and the moving average of those two buffers would be....

//---


Code:
     jpyma[i] = iMAOnArray(jpy,0,10,0,0,i) ;
     gbpma[i] = iMAOnArray(gbp,0,10,0,0,i) ;
//----

i'll look at your mq4 this weekend,,,,,,h
//----

gbpusd-d1-oanda-division1.png


//----

gbpjpy-h4-oanda-division1.png
 

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
For what it is worth, I got the lines to start drawing. What perplexes me, however, is that I could not run it in my original code, but I can now. In my original For-Loop, I create the arrays that feed the buffers. My understanding of the loop is I could check for a cross at the same time as iterating for the buffers. However, I got no such luck. After creating a second For-Loop completely separate from the first, I iterated again through the buffers, checking for a cross and drawing the object.

Just for a teaching perspective, can you explain why my object was not drawing properly within the single For Loop? I copied the working code below. Originally, the second block was simply located in the scope of the first loop. Another oddity... The alert is working just fine in the original For Loop. scratching my head on this one.



MQL4:
   for(int i=0;i<limit - 1;i++)
     {
 
 
 
//---Determine MTF  
      shift(timeperiod, i);
 
      Pair1[i]    = pairs(pair1);
      ObjectSetString(0, "Pair1", OBJPROP_TEXT, pairslist[pair1]+ ":  "+DoubleToStr(Pair1[0],3));
      Pair2[i]    = pairs(pair2);
      ObjectSetString(0, "Pair2", OBJPROP_TEXT, pairslist[pair2]+ ":  "+DoubleToStr(Pair2[0],3));
      max[i]      = -15;
      min[i]      = -85;
 
 
      if(Pair1[i+1] < Pair2[i+1] && Pair1[i] > Pair2[i])       Alert(pairslist[pair1]+pairslist[pair2]+" Bullish Cross");
      if(Pair1[i+1] > Pair2[i+1] && Pair1[i] < Pair2[i])       Alert(pairslist[pair1]+pairslist[pair2]+" Bearish Cross");
 
 
 
     }
 
   for(int i=0;i<limit - 1;i++)
     {
      if((Pair1[i+1] < Pair2[i+1]) && (Pair1[i] > Pair2[i]))
         {
         if (ObjectFind("Buy 3 Little Piggies"+i) != 0)  
            {
            ObjectCreate( "Buy 3 Little Piggies"+i, OBJ_VLINE, 0, Time[i], 0 );
            ObjectSet( "Buy 3 Little Piggies"+i, OBJPROP_COLOR, Blue );
            }
            bought = true;
            sold   = false;
 
 
         }
 
 
      if((Pair1[i+1] > Pair2[i+1]) && (Pair1[i] < Pair2[i]))
         {
         if (ObjectFind("Sell 3 Little Piggies"+i) != 0)
            {
            ObjectCreate( "Sell 3 Little Piggies"+i, OBJ_VLINE, 0, Time[i], 0 );
            ObjectSet( "Sell 3 Little Piggies"+i, OBJPROP_COLOR, Red );
            }
            bought = false;
            sold   = true;
         }
 

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Another note - I am curious about your premise of this indicator and if it holds promise. The idea is not just to examine the explicit WPR of a pair. Rather, the cross will only happen when the entirety of the first pair is stronger (per the WPR) than the cross currency in its entirety. Naturally, using different Time Frames can offer a unique MTF look.

Also, with this method, I think there is room for numerous use cases. One such would be to look when the pair is at extreme opposites of the WPR. Or, when Currency A is stronger in a larger time frame but Currency B tops out in the lower tf. Could be a large scale shift, but perhaps could be a higher Low/Lower High - continuation of the higher TF trend.

The list can go longer, but I suppose the promise I see here is not just what is the MTF analysis of the Weekly, Daily, and 4H GBP/JPY. Rather, you can get the Weekly, Daily, and 4H of the entire GBP and entire JPY and proceed. I feel that is so much more information allowed to the trader.
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
Originally, the second block was simply located in the scope of the first loop.
//----

hey tc..... i usually keep it all in one loop..... seems to work.....

i saw a few possible errors in one of your first 2 indicators but nothing that would cause a problem..... my approach is different......

will post an example of your wpr test......h
//-----


Code:
int start()
 {
   double week;
   double day;
   double four;
 

  
   int limit = Bars - IndicatorCounted();
   for (int i = limit - 1; i >= 0; i--)
 
    {
      
      int bar10080        = iBarShift(NULL,10080,Time[i]);
      int bar1440         = iBarShift(NULL,1440,Time[i]);
      int bar240          = iBarShift(NULL,240,Time[i]);
      int bar60           = iBarShift(NULL,60,Time[i]);

          fourup[i]    = EMPTY_VALUE;
          fourdn[i]    = EMPTY_VALUE;
          dayup[i]     = EMPTY_VALUE;
          daydn[i]     = EMPTY_VALUE; 
          weekup[i]    = EMPTY_VALUE;
          weekdn[i]    = EMPTY_VALUE;
    
          four       = iMA(NULL, 240,   fourmaperiods, 0,0,0, bar240);
          day        = iMA(NULL, 1440,  daymaperiods,  0,0,0, bar1440);
          week       = iMA(NULL, 10080, weekmaperiods, 0,0,0, bar10080);

      
      
      if(iClose(NULL,10080,bar10080) > week)    weekup[i]  =  0.57;
      if(iClose(NULL,10080,bar10080) < week)    weekdn[i]  =  0.57;
      if(iClose(NULL,1440,bar1440)   > day)     dayup[i]   =  0.37;
      if(iClose(NULL,1440,bar1440)   < day)     daydn[i]   =  0.37;
      if(iClose(NULL,240,bar240)     > four)    fourup[i]  =  0.17;
      if(iClose(NULL,240,bar240)     < four)    fourdn[i]  =  0.17;
 
 
    
 
      if(!bought && ((weekup[i] != EMPTY_VALUE) && (fourup[i] != EMPTY_VALUE) && (dayup[i] != EMPTY_VALUE)) && ((weekup[i+1] == EMPTY_VALUE) || (fourup[i+1] == EMPTY_VALUE) || (dayup[i+1] == EMPTY_VALUE) ) )
         {
         if (ObjectFind("Buy 3 Little Piggies"+i) != 0)   
            {
            ObjectCreate( "Buy 3 Little Piggies"+i, OBJ_VLINE, 0, Time[i], 0 );
            ObjectSet( "Buy 3 Little Piggies"+i, OBJPROP_COLOR, Lime );
            }
            bought = true;
            sold   = false;
            

         }
        
      
      if(!sold  && ((weekdn[i] != EMPTY_VALUE) && (fourdn[i] != EMPTY_VALUE) && (daydn[i] != EMPTY_VALUE)) && ((weekdn[i+1] == EMPTY_VALUE) || (fourdn[i+1] == EMPTY_VALUE) || (daydn[i+1] == EMPTY_VALUE) ) )
         {
         if (ObjectFind("Sell 3 Little Piggies"+i) != 0)
            {
            ObjectCreate( "Sell 3 Little Piggies"+i, OBJ_VLINE, 0, Time[i], 0 );
            ObjectSet( "Sell 3 Little Piggies"+i, OBJPROP_COLOR, Red );
            }
            bought = false;
            sold   = true;
         }
 



    
   }
 

 
 
 
   return (0);
}
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
Another note - I am curious about your premise of this indicator and if it holds promise.
//-----

yes i see plenty of promise in most all indicators...... now make a cci version of your indicator with a alert at +/- 350,,,,,,

one thing about momentum and strength indicators is their signals/indications can be seemingly misleading .....

imagine a car taking off fast from 0 to 60...... the initial momentum and rsi values will be tremendous ..... now imagine at 60 they back off the pedal so while still gaining speed it's doing so slowly...... both rsi and momentum might begin to fall even though the car's direction has not changed and it's still gaining speed, albeit more slowly.....

the same idea applies to forex and might be why some traders distrust indicators.... they might not understand the indicators true indication....

this is why moving averages can be helpful.....
//------

look at my version of your mtf wpr currency combined......

notice how simple and minimalistic the code is..... my goal is not one character too many or one character to few,,,,,,h
//-----
gbpjpy-h4-oanda-division1.png
 

Attachments

  • wpr multi tf per currency.ex4
    16.5 KB · Views: 4
  • wpr multi tf per currency.mq4
    4.2 KB · Views: 14

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
I have a rough work week ahead, but I will do that with the CCI. Your code makes my head spin. When I read it, I want to slap my forehead and say "duh". But when I type it, I am unable to think that succinctly, and thus you see all my silly functions at the bottom lol.
However, regarding the CCI, while I will make it, doesn't that indicator suffer from the faults you mentioned from the car analogy? For example, wont the CCI begin to falter simply due to slowed momentum even if the move continues?

Please correct me if I am wrong, but my understanding of the WPR is simply to say "currently, the GBPJPY is trading in the upper 30% of the last 40 length trading range". Naturally, as the range constricts, the indicator will become more sensitive, but it's not simply reliant upon the momentum of the move to make a meaningful change.

Again, I am not trying to say that there is no need for different styles of indicator (currency strength vs momentum), but I just want to make sure my understanding of the indicators is correct.
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
However, regarding the CCI, while I will make it, doesn't that indicator suffer from the faults you mentioned from the car analogy? For example, wont the CCI begin to falter simply due to slowed momentum even if the move continues?
//------

absolutely...... now how can that be used to our advantage.....

by viewing it as a possible opportunity knocking at your door......

when the major timeframes are all moving in the same direction and still young in regards to length, extreme spikes against us on the lower tf's can be additional entrys.....

in other words, on the lower tf's search for spikes +/- 300 on cci that are against your positions ..... we might never know what caused the brief spike which will melt..... quite often the original trend will continue ......

this why i want to know the average length of all indicators....... once you approach that length, cease answering that door......

the risk is too great.....h
//----





eurjpy-m1-oanda-division1.png
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
I have a rough work week ahead, but I will do that with the CCI. Your code makes my head spin.
//-----

lol...... and your code makes my head spin to...... lol..... if i can't write it first in my mind, i'll turn the page......

yeah i hear ya on rough weeks....... we have been working daylight to dark, 13 on and 1 off for about a year and a half now...... that's one reason for my absence ......
//----

if it would be me, i'd scale back my code to things far simplier ...... you started with probably the most difficult concept imaginable..... i think i heard enivid laughing clear over here..... lol.....

it was 5 years before i ever thought of tackling that complex type code..... and another 5 to complete.....

my first code was just simple dots.... the dots were rules.... buy if all said buy..... sell if all said sell.....

right now all i can think about is selling the audusd..... for some reason that is always the case...... wanting to buy when should be selling ..... and wanting to sell when should be buying...... which is the definition of 'hayseed'......

the dots were my hayseed vaccine....... and yes, have to get a booster shot every now and then...... maybe one day it will be available in pill form..... h



//----

audusd-d1-oanda-division1.png
 

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
learning to code might not assure you a seat in that top 5 % of forex traders, no more than learning to fly will assure you a seat in the top 5 % of pilots......

but it might keep you out of the crash and burn seats......h

//-----
Antoniuk Oleg's MQL4 book for us beginners .......
//----
 

Attachments

  • mq4 tutorial.pdf
    1.1 MB · Views: 12
  • 👍
Reactions: TradeChaser

hayseed

Master Trader
Jul 27, 2010
839
215
109
usa
one of my favorites............. candlesticks fibonacci and chart pattern trading tools........

the hard cover version runs about 70 bucks....... which is another way of saying 70 pips on 1 eurusd mini lot......

chapter 1 is my favorite...... h
 

Attachments

  • candlesticks fibonacci and chart pattern trading tools.pdf
    2.2 MB · Views: 15
  • 👍
Reactions: TradeChaser

TradeChaser

Active Trader
May 12, 2020
159
6
34
31
Thanks for sharing! I can’t wait to tear into it!

I agree with your 5% comment. What has made me so frustrated about trading is I believe coding is the only way for me. If I don’t look at charts regularly, I lose place when I revisit them. I attribute this to a natural bias.

I analyze a chart, and say “I’m waiting for this level or indicator to break”. I come back later, but if it’s not right at the break or indicator, if it’s after the signal a bit, I get in my own head of whether it was a good signal or not.

That is why I want to use coding to give me a drop-dead, “enter now because your criteria is met” type system. Due to my work, I simply don’t have time to check the charts unless I’m off work or I know it is simply for an entry.

Perhaps with coding my custom signals, one day I can accomplish those ends.

And yes, the strategy must also be a profitable one, or else none of the above matters.

I personally, want to make my WPR/Currency strength indicator work. Maybe that blinds me, and perhaps it’s because I thought of it on my own that I want to see it succeed.

There is just something comforting about knowing at a five point in a currency cross that the currency I am currently buying isn’t just stronger in that pair, but across all pairs.

But just like any indicator, it’s just an array of old data points that I cross my fingers will point me where I think I am going!