MQ4 Code Works

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
Dashboard is coming together

the first column is ZZ legs... if leg is longer than average (in bars), the colors are dull
second column is an amalgamation of the data on the right. each of those are divided into two groups of four. The left most are longer signals (TSR, QQE, etc). The right quartet is fast signals (alma, jjma, jfatl, ao). Slow signals get a point (-1 for bearish), the fast signals get .75...

Each tf gets a score... if the score is over 5 or under -5, the colors are dull so as to show a trend that may be long in the tooth (with more weight on the longer signals).

Bottom is the WPR indicator I wrote showing the symbol strength. to your point, the Pound is been trending weaker than the CAD all through the last 6 monts... may look to sell into some GBP strength on that pair. Fresh signals on the daily point to a possible play next week?

1651465877911.png
Post automatically merged:

for the trade view... upper right is the same arrows from the dash... signal health on top, last ZZ on the bottom.

and my WPR MACD on the bottom as well. I think this may be my signal of signals, but who is to say.
1651466197214.png
 
  • 👍
Reactions: hayseed

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
//-----

if you give a farmer a crop he can grow and get rich, he will produce himself into bankruptcy almost every time......

be wary of the zigzag(75)...... once it prints, look for another crop....... without a doubt the trend might continue...... you might leave a fortune on the table...... but odds of a 3 day killer retrace will have increased.....

at a minimum, wait for a daily zigzag(12) leg against the zigzag(75).....

the sell signal was a couple months ago..... for me, the risk is not worth the reward...... the goose is almost cooked......

might be better fish to fry......h
//------
gbpcad-d1-oanda-division1-wary-of-the-75.png
I agree! I hope you see the work I have put in as showing that I am not looking for a free lunch. just trying to understand this game like you do.

I am now building things that when I first started mt4 used to amaze me.

Would you mind sharing how you configure your ZZ? It looks like it may be Multi time frame? However, when I iBarShift it is simply squared off rather than meeting at the proper points. Can't quite seem to get it right!
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
Would you mind sharing how you configure your ZZ? It looks like it may be Multi time frame? However, when I iBarShift it is simply squared off rather than meeting at the proper points. Can't quite seem to get it right!
//-----

hey tc...... not sure i'm following you..... what are you referring to as 'configure'......h
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
//-----

hey tc...... not sure i'm following you..... what are you referring to as 'configure'......h
Hayseed,

In the picture below. I assume that the zig zigs all just have different “Depth”.

I’m just curious what inputs you use to achieve that look:
 

Attachments

  • EBB6707C-2026-43E9-8354-0FA23A82B701.png
    EBB6707C-2026-43E9-8354-0FA23A82B701.png
    408.2 KB · Views: 10

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
Hayseed,

In the picture below. I assume that the zig zigs all just have different “Depth”.

I’m just curious what inputs you use to achieve that look:
//----

yes that's just the 5, 12 and 75 zigzags on same chart.......

the zigzag setting determines the lot size and spacing...... zigzag(5) will have smaller lot size and fewer orders closer spaced..... (12) might have twice the lot size , twice the number and twice the space...... (75), larger lot still and orders on fibonacci retrace values..... often martingaled .....

once you think about it the idea comes clear......h
//-----

gbpjpy-h1-oanda-division1-close-em.png


//-----
audcad-h1-oanda-division1-close-em.png


//------

audchf-h1-oanda-division1-close-em.png


//---
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
Hayseed -

Can you inspect these scanners and tell me if I am getting warmer? the first is a general JJMA/Alma scanner. First it checks the tsr on the same TF. then It checks if the higher tf is beyond its average length on the tsr, and then checks the new bar for an Alma or JJMA turn (others, but I have turned them off). I have these for 240, 1440, and 10080 (each checking the next higher tf for signals).

there are some includes that I have not attached, but I am hoping from the general structure that you can critique.

Also, some questions to better understand your entries:

1. are you using the Peyton indicator at all for your "Minimum Wage"? If so, is it an entry indicator, or just an indicator you consult prior to entry?

2. are you setting a common takeprofit, or do you have a pip level take profit per trade? Your image above certainly suggests you are, but I am just not sure if that's the common practice given how precise the average profit per trade is ($7.50 on your minimum wage).

3. you mentioned not closing trades until you are $1,000 in the hole. However, you have some very miniscule losses (5 on the "next week" and 2 on the "minimum wage"). Why did you exit these trades? Is there an early indicator that you utilize to determine when to exit other then overall balance?

Apologies in advance for the many questions. I have been coding more and more every day, but I am not fully understanding how you programmatically take an alma signal, or a JJMA signal, etc - and enter.
 

Attachments

  • AlertScan_240_ContinuationCheck.mq4
    10.4 KB · Views: 17
  • AlertScan_240_ExhaustionCheck.mq4
    8.5 KB · Views: 18

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
Hayseed - cannot tell you how illuminating these videos were. Other than the coding videos, I would venture to say I gained more from these than any others.

I have some sound bites/questions from those two videos. Will try to clip the video and organize the questions this evening.
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
//------

what did that little kid say in the movie 'the shining'..... red rum, red rum.......

and what often follows a red rum red rum...... a red two a red two......h
//------

eurjpy-w1-oanda-division1-red-1.png

//-----
I am still trying to build my response video, so that is coming. Again, so much illuminating info.

That said, I recall in the video, you mentioned venturing above the 60 minute chart is for when you’re “real desperate”, and that the 30/60min is more traceable.

So when you point out a Red 1 on the 10080, is that simply to say, when I get a signal on the 60 min or 30 min, you’ll feel more confident because you have the tailwind of a weekly signal at your back?
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
That said, I recall in the video, you mentioned venturing above the 60 minute chart is for when you’re “real desperate”, and that the 30/60min is more traceable.

So when you point out a Red 1 on the 10080, is that simply to say, when I get a signal on the 60 min or 30 min, you’ll feel more confident because you have the tailwind of a weekly signal at your back?
//----

exactly..... there was both a 60 and 240 sell signal at that video and a the daily counts had several red ones and zeros..... so it was all taking shape..... we now have a daily sell signal.....


when i mentioned 'real desperate', i meant placing limit orders covering the last zigzag leg..... the 60 minute leg's pip range can be large ..... the draw down equally so..... there are times when i might cover the 240 but except in advance the possibility of huge drawdown..... seldom do it.....


my preference in this exact case, todays eurjpy, would be to wait for a 240 up leg and then trail the psar with a large lot sellstop.....

it might take a few days for yesterdays down move to accepted..... the uptrend might continue.....

even with the daily signal, i'll watch for a while......h
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
//----

exactly..... there was both a 60 and 240 sell signal at that video and a the daily counts had several red ones and zeros..... so it was all taking shape..... we now have a daily sell signal.....


when i mentioned 'real desperate', i meant placing limit orders covering the last zigzag leg..... the 60 minute leg's pip range can be large ..... the draw down equally so..... there are times when i might cover the 240 but except in advance the possibility of huge drawdown..... seldom do it.....


my preference in this exact case, todays eurjpy, would be to wait for a 240 up leg and then trail the psar with a large lot sellstop.....

it might take a few days for yesterdays down move to accepted..... the uptrend might continue.....

even with the daily signal, i'll watch for a while......h
interesting.

Do you show a preference in trade entries? For example, if 240 and above are more single, large lot style trades, do you prefer that to the zigzag covering trading you’d do on smaller time frames?

Or would the single large lot trade be that first trade of the continuation to the down side, after which you would return to the the smaller waves? Until as you put it, all legs are down and you have to wait for a change?
 
Last edited:

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
interesting.

Do you show a preference in trade entries? For example, if 240 and above are more single, large lot style trades, do you prefer that to the zigzag covering trading you’d do on smaller time frames?

Or would the single large lot trade be that first trade of the continuation to the down side, after which you would return to the the smaller waves? Until as you put it, all legs are down and you have to wait for a change?
//-----

somehow sometime someway, i started using the term resolution...... can't remember why...... and don't think it's the correct term..... this was long before nfa's ridiculous fifo and no hedge rules....

resolution refers to my preference of placing one hundred 0.01 limit orders spaced 1 pip apart than placing a single standard lot at market ..... the single standard lot order will make/or lose more...... thats ok..... making the most is not in my mind...... losing the least is.......

on indicator type triggers there will almost always be some price wiggle room..... i placed quite a few orders a few hours ago in preparation for next week..... there is almost no doubt some will go under water for a bit......

i had hoped the markets would retrace half of wednesday move..... it has not...... this is a non standard week......

yes, i have a preference for trades.....

remember the red rum red rum........ an example of my preference is a 240 sell signal with a weekly red 1......

there are several such live examples right now......

keep in mind, a normal trade to me is <= 0.03..... and thats on a 30k account...... i will probably put in 6 or 7 , 0.11 trades this morning...... the odd size is so i can at a glance know those are next weeks trades ...... i really needed a larger retracement....... those trades should make 50$ apiece.....

the 0.01 up to 0.05 trades will be for 60 and 240 zigzag retracements...... 10 or 20 pips apart covers 100 to 200 pips..... quite a potential draw down......

if i'm really comfortable, i'll place sell stops below with twice as many sell limits above..... using odd number orders down in reverse , 0.05, 0.03, 0.01,,,,, and even numbered orders up, 0.02, 0.04, 0.06,,,,,, allows me to have targets with oanda's unique lot size rule...... sometimes ten orders total, 0.01 thru 0.10 ......

when things appear perfect i might place a 2 minilot or greater trade...... those are rare for me......

i track and categorize every single trade..... <= 0.03 trades are consistent producers for me...... h
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
keep the atr left in your mind...... once the atr has passed it's limits, might be a good time to catch up on the honey-do list......h

//-----
eurusd-w1-oanda-division1-atr-left.png
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
keep the atr left in your mind...... once the atr has passed it's limits, might be a good time to catch up on the honey-do list......h

//-----
eurusd-w1-oanda-division1-atr-left.png
Is there a timeframe that you respect most with that?

For example, are you scrutinizing all the tf, or would you say the W1 is the most significant use of atr left?
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
All higher timeframes but some are show stoppers....

look at the average weekly gbpjpy, 273 average and it’s now 646..... average monthly 749 and it’s now 937......

Odds favor a much needed retrace.....

The 60 minute and below are iffy.....

I rather be the buyer or seller of last resort than the last buyer or seller...... might sound the same but it’s not.....

Atr helps assure that......h
 

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
I am trying to code some alerts based on some of the stuff you mentioned... another questions has come up...

As far as data mining goes with zz, do you care as much about the current "duration" of the last zz leg, or are you more concerned with the pip difference between the extremums?


For example, let's say the weekly PSAR gave you a bearish signal (first dot)... you then get a new zz leg up on the 240... this is good, but maybe to decrease your odds of drawdown, you want to wait until that leg has gotten stale...

Do you care more about the leg lasting longer than normal, or the leg extending farther?

Surely you could get that countertrend 240 leg lasting longer than average, but maybe not be over-extended - maybe this shows the counter trend move losing steam...

ramblings....
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
I am trying to code some alerts based on some of the stuff you mentioned... another questions has come up...
//-----

those are very good questions....

the audcad 10080 chart currently has a single red dot...... take the 240 chart with just the zigzag..... check the fibonacci retrace on each countertrend leg.....

you will quickly see why the 'boxed fib trades' were used...... orders placed on the fib levels..... sometimes limits sometimes stops....... stops have the lowest draw down.......

would feel completely comfortable placing a such orders on the audcad.....

would be more concerned with current zigzag count..... in other words if the count was a lime 7 and there were several red 0's, odds favor a fall......

remember to measure the fib retracements of the last several audcad 240's like the picture below......h
//------

audcad-w1-oanda-division1-1-dot.png


//-----
audcad-h4-oanda-division1-240-fib.png


//-----
GBPJPYH4 box.png

//-------
 

hayseed

Master Trader
Jul 27, 2010
1,157
275
149
usa
I am trying to code some alerts based on some of the stuff you mentioned...
//-----
try putting the alerts into a single script with true /false selections....... which then calls includes......

by using includes, the working code stays safe....... just call the function in the script......

i've put one in it for example...... if you wanted a macd cross alert, just create its own include and add it to the scanner script......

and so on.......

mqh goes into the includes folder, just save don't compile...... mq4 goes in the scripts folder., compile after every change even if the change was in an include......h
//-----
 

Attachments

  • psarscanner.mqh
    2.1 KB · Views: 20
  • scanners.ex4
    7.3 KB · Views: 13
  • scanners.mq4
    976 bytes · Views: 28

TradeChaser

Active Trader
May 12, 2020
169
6
34
32
//-----
try putting the alerts into a single script with true /false selections....... which then calls includes......

by using includes, the working code stays safe....... just call the function in the script......

i've put one in it for example...... if you wanted a macd cross alert, just create its own include and add it to the scanner script......

and so on.......

mqh goes into the includes folder, just save don't compile...... mq4 goes in the scripts folder., compile after every change even if the change was in an include......h
//-----
This is actually something I started because of you, and I love what it does. I stray away from it because I start tinkering with an open indicator or code and before you know it one indicator is a patchwork of unique ideas.

And once include is linked to two others and so on…

I need to clean up my includes.

But I will do just that!