"Pin Bar" Alerts

lurkerlurker

Senior member
Messages
2,482
Likes
150
The purpose of this thread is to discuss the implementation of a software package (or plugin to an existing trading platform) to scan a predefined instrument list at regular intervals looking for "pin" bars.

Over on TD's "Making Money Trading", great use is made of hourly pin bars on FX, indices, and commodities. We would like some software which will scan 30 or so FX and futures markets for hourly pin bars at the close of each hour. The software should then output the names of the instruments showing a pin bar to either a local file, email, or website.

TD and others using this system work full time, and while they may have the time to enter orders if they see a pin they would like to take based on confluence with other price action factors, it is not feasible for them to manually check 30 or so charts on the hour every hour.

So, if any programmers would like to weigh in here with ideas, we would appreciate it. Currently the preference is for developing a plugin/extension/script for MT4 as we have free real time feeds for FX and futures with this platform. The software shall:

  • Be able to flag a pin bar when it occurs
  • Scan multiple instruments
  • Provide automated output when it finds a pin

Additionally, the software should:

  • Accept user defined instruments and timeframes to search
  • Have used defined timeframes and testing intervals
  • Show the names of the instruments showing a pin bar in an accessible data format which can then be used as the basis for an email alert or web page

Assistance with this project would be greatly appreciated. Please refer to the thread "Making Money Trading" (link in signature) for more information on this trading method. TD has done a great job teaching new traders how to execute high probability low risk entries using this price action pattern on both daily and hourly charts. It would be useful to all of us to be able to check if a valid signal may have occurred on the many instruments we would like to monitor each hour.

Thanks in advance.
 
Within MT4, you can send email alerts. From some brief reading, it appears that you can use the SendMail command to give an alert using email settings defined in the software.

We already have a MT4 script which detects pin bars (which I am awaiting permission to publish. We could insert something like

SendMail(Symbol()+" Pin bar found");

into the function which detects pin bars to have it send an email when it finds one.
 
Hi lurker,

MT4 experts indicators and advisors are all over the web....there will be i'm sure something out there in the public domain...weather or not these are any use is the question...a lot of this stuff is very badly written for starters so this is why its best to send anything thats posted for evaluation....makes sense...i for one would'nt want some half baked useless indicator advising newbies to do this do that etc...without first finding out How it works ...and What its telling us.....and I think the real point in all this is...they may only be used as comfort indicators anyway...the top and bottom of it is.....no indicators are a substitute for " doing the work " ;)
 
  • Like
Reactions: ian
Hi lurker,

MT4 experts indicators and advisors are all over the web....there will be i'm sure something out there in the public domain...weather or not these are any use is the question...a lot of this stuff is very badly written for starters so this is why its best to send anything thats posted for evaluation....makes sense...i for one would'nt want some half baked useless indicator advising newbies to do this do that etc...without first finding out How it works ...and What its telling us.....and I think the real point in all this is...they may only be used as comfort indicators anyway...the top and bottom of it is.....no indicators are a substitute for " doing the work " ;)

To be clear, there is only one purpose for doing this:

To let TD and I know at a glance whether we need to look at a chart every hour.

That is to say that the software should provide an alert for anything which resembles a pin bar, and give us the instrument name. We can then look at the chart for ourselves. However, this means we will know at a glance how many of the 30 odd charts we would need to pull up - obviously TD can't be expected to spend 30 minute on one of 30 instruments on the hour every hour - that is a quarter of the working day!

We want something which tells us where to look when there is a signal. Obviously we'd then take a look at the pin on a chart to see if it was worth taking, but we are both sick of missing signals because we only have time to check 5 or so instruments every hour.

So far, I'm hacking at the MT4 file I've been given. It detects pins, and I've written code into it to send an email when it sees one. This works. Unfortunately, it works too well and sends a few hundred emails per instrument (all the pins previously on the chart).

I've dropped down to a 1 minute so I can see if it triggers an email in real time. What I then intend to do is pull up 50 or so instruments on the 15M, tell it to look for pin bars, disable the email, add the indicator, enable the email, and leave it running overnight.

If it gives the proper signals during the night, I'll then switch it to hourly monitoring only, and write a perl script which goes into the .Maildir of the user I've set up for this, extracts the subject from the emails, and outputs it to foo.html on my webserver, so that we can access http://myserver/foo.html which should have output such as

"22092007 21:01 BEARISH Pin formed on EURUSD"
"22092007 21:01 BEARISH Pin formed on EURGBP"
"22092007 22:01 BULLISH Pin formed on GBPJPY"


etc.
 
Within MT4, you can send email alerts. From some brief reading, it appears that you can use the SendMail command to give an alert using email settings defined in the software.

We already have a MT4 script which detects pin bars (which I am awaiting permission to publish. We could insert something like

SendMail(Symbol()+" Pin bar found");

into the function which detects pin bars to have it send an email when it finds one.

[my emphasis added]

good for you. coincidentally, just this morning, I was asking about sending signals to SMS. Could you show an example where the SendMail command works?
not asking you to reveal any programming secrets, just any example would be useful.

hope you didnt have to write your code from scratch, as
http://codebase.mql4.com/indicators
seems to be a good base to work from.
 
Okay, that is all well and good. The email works. It works so well that it sends an email every second for every pin bar on that instrument. A few thousand emails later...... Thankfully I'm running this on my own servers.
 
[my emphasis added]

good for you. coincidentally, just this morning, I was asking about sending signals to SMS. Could you show an example where the SendMail command works?
not asking you to reveal any programming secrets, just any example would be useful.

hope you didnt have to write your code from scratch, as
http://codebase.mql4.com/indicators
seems to be a good base to work from.

Hi trendie

Not a problem - no secrets here. The issue is that somebody gave me the MT4 script which I have now modified to send email. I used the website you refer to for documentation for the sendmail script. I don't know how to use SMS just yet - I'm working on email.

I don't mind posting the script, but I need permission from the author first. Stay tuned.

On a semi-related point - do you know how to stop MT4 sending emails EVERY SECOND?
 
no. but I dont have a problem having a look at it tomorrow mid-morning onwards.

Cheers. It appears that a variable value in my code will change every tick, causing notification of the pin bars already displayed on the chart to be sent every few seconds. Obviously this is not in order, but I don't know how to fix it yet.

I've spent 90 minutes on this already tonight, and have got quite far, but I have other things to do.

Summary:
Pin bar code imported into MT4
Code edited to send mail when it sees a pin bar
New user setup on my mail server to deal with pins
MT4 set up with SMTP details
Web IMAP interface set up

To-do:
Stop MT4 sending repeat alerts
Test with multiple concurrent pairs
Write perl script to output the pertinent parts of the maildir to a webpage

Optional:
Prettify the output
 
Okay, I've got the pin bar alerts provisionally setup.

I've loaded hourly charts of 15 instruments, 13 of them FX. It initially sent over 1k emails, but I don't suppose this can be helped. They are now deleted, and as far as I am aware it should send out an email the next time a pin bar closes.

I've noticed that the script has some false positives, which is okay, but also that it overlooks bars we would consider pins (which is not). Perhaps the parameters need a little more tweaking in favour of more sensitivity.

Bars close in 10 minutes, so I will see if I get a flood of updates again. If not, we are pretty close to getting it working.

I'll make a website available to you guys when I get this working. Said website will name any instrument on our watchlist which has just closed a pin bar on the H1 charts.
 
Okay, I've got the pin bar alerts provisionally setup.

I've loaded hourly charts of 15 instruments, 13 of them FX. It initially sent over 1k emails, but I don't suppose this can be helped. They are now deleted, and as far as I am aware it should send out an email the next time a pin bar closes.

I've noticed that the script has some false positives, which is okay, but also that it overlooks bars we would consider pins (which is not). Perhaps the parameters need a little more tweaking in favour of more sensitivity.

Bars close in 10 minutes, so I will see if I get a flood of updates again. If not, we are pretty close to getting it working.

I'll make a website available to you guys when I get this working. Said website will name any instrument on our watchlist which has just closed a pin bar on the H1 charts.

Excellent work !! Impressed....You answering your skype messages anytime soon !!?!!??!! Hard man to get hold of !! Speaking to Tom earlier he said you'd be around...your skype has remained offline !!
 
Modified some of the code with a little help from the orignal author. Email alerts work, and I've set a cron job to spit them out onto a webpage. Right now I am just testing it. This hour it called pins on GOLD and CHFJPY - they are pin bars, but not valid ones, so no trades, but it drew my attention to them. I'm going to be monitoring this every hour during the day for a few days, and will put it live if it works as desired.
 
Skeleton website UP!

I have a skeleton version of the alert service working.

It is in the form of a website which is to be reloaded once per hour just after 1 minute past the hour. It should give the names of any instrument which is showing something which resembles an hourly pin bar.

Naturally, it is up to the operator to pull up a chart of that instrument and engage brain. It will give false positives. The idea is to save time by removing the need to load 30 odd slow charts on the hour every hour.

Some users of these boards have warned me that I should not make the URL public as people may start using it to take trades without fully understanding what they are doing. This website is not intended to be guidance to buy or to sell. It merely gives the name of any instruments which have just drawn a bar which conforms to criteria set in a computer algorithm. It is designed to advise which charts to check, not as a substitute for "doing the work".

Feel free to send a PM for the URL.

Finally, I hope this doesn't fall foul of the site rules (although since a mod suggested this thread, I shouldn't think it would).

Hope this is helpful to people following TD's thread.
 
Some Ideas...

Hey Lurker,

How about getting the pin bar screener to run 10 mins before the hour is up so there is some prior warning to enable a trade to be evaluated? Also why don't you publish alerts as an RSS feed so that the info can be read with any RSS reader such as Google reader IE etc...

Just some thoughts....

Matt
 
No signs of any pinbar indicator yet....anyone interested or is it a dead duck.

Seen a version of this Pinbar finder and I must say Lurker's work is VERY IMPRESSIVE. It is picking up Pinbars. Hats off mate to a sterling job....well done.

Hope I'm not stealing Lurker's thunder by posting this....but from what I gather he has burnt the midnight oil to get this together !!
 
There seems to be some confusion here.....

What I offered to do was run any pinbar indicators by a programmer collegue.. who is frankly an expert on the MT4 stuff...this talk of alerts and such like is secondary to making sure that the pinbar indicator does what it says on the tin.

So, if anyone has any of these MT4 pinbar indicators...please post them here and we can get cracking.

cheers
cv
 
Last edited:
There seems to be some confusion here.....

What I offered to do was run any pinbar indicators by a programmer collegue.. who is frankly an expert on the MT4 stuff...this talk of alerts and such like is secondary to making sure that the pinbar indicator does what it says on the tin.

cheers
cv

agree with you that it needs to do what it says on the tine !

I AM NOT involved at all with the development work and merely posted on the thread because I was impressed with what Lurker has achieved. I am not a programmer nor a developer nor do I have any knowledge on the back engine code that needs to be written to make this possible.

Really just pointing out that Lurker seems to have achieved what he set out to do, from what I saw it certainly seems to do what it says on the tin.

Once again well done mate.

Mark
 
No signs of any pinbar indicator yet....anyone interested or is it a dead duck.

Dead duck? I had it done from concept to implementation in under 24 hours, and I tested it hourly through the last 20 hours of the FX market last week and I am very very happy with it. I thought I sent you the URL by PM - if not get in touch and I'll give you it!
 
There seems to be some confusion here.....

Yes, there is- I currently have a website which spits out the names of FX pairs and futures which have formed an hourly pin - it isn't pretty, but it works.

Regarding RSS - that is on the to do list, and I will get to it when I have the time.

Thanks for the feedback.
 
Top