• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:00pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 5:00pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Print Thread

Similar Threads

The Stock/ETF/Commodity Pinbar Thread 122 replies

Pinbar indicator 6 replies

Pinbar and S/R scanner 6 replies

got to do with a hanging man and a pinbar 1 reply

J16 pinbar discussion 7 replies

  • Platform Tech
  • /
  • Reply to Thread
  • Subscribe
  • 2
Attachments: Simple pinbar EA
Exit Attachments
Tags: Simple pinbar EA
Cancel

Simple pinbar EA

  • Post #1
  • Quote
  • First Post: Edited 12:31pm Jul 20, 2010 12:20pm | Edited 12:31pm
  •  Gambler180
  • | Joined Mar 2007 | Status: Member | 756 Posts
I am trying to create a simple EA that recognizes pinbars. I would like the EA to check every currency pair while only attached to one chart but it doesn't check the specified currency. If I write null instead of "EURUSD" and attaches it to a EURUSD chart it works. What have I done wrong?

Here is the code.
Quote
Disliked
if (iClose("EURUSD",PERIOD_MN1,1) - iOpen("EURUSD",PERIOD_MN1,1) > 0.0001 && iClose("EURUSD",PERIOD_MN1,1) - iOpen("EURUSD",PERIOD_MN1,1) < (iOpen("EURUSD",PERIOD_MN1,1) - iLow("EURUSD",PERIOD_MN1,1))/2)
{
Alert("Pin bar");
}
If slaughterhouses had glass walls, everyone would be a vegetarian!
  • Post #2
  • Quote
  • Jul 20, 2010 1:04pm Jul 20, 2010 1:04pm
  •  TJPLD
  • Joined Jan 2008 | Status: Inertial Member | 2,297 Posts
Do you have a Broker that calls their Paris EURUSDm or EURUSDcx or something like that?
 
 
  • Post #3
  • Quote
  • Jul 20, 2010 1:14pm Jul 20, 2010 1:14pm
  •  Gambler180
  • | Joined Mar 2007 | Status: Member | 756 Posts
Quoting TJPLD
Disliked
Do you have a Broker that calls their Paris EURUSDm or EURUSDcx or something like that?
Ignored
I don't know. I use liteforex. In the market watch window nothing is written after the name of the currency pair.

Edit: I have previously made an EA that checks many different currency pairs and it worked in lite forex. I just don't remember how I did it.
If slaughterhouses had glass walls, everyone would be a vegetarian!
 
 
  • Post #4
  • Quote
  • Jul 20, 2010 1:30pm Jul 20, 2010 1:30pm
  •  hayseed
  • Joined Nov 2006 | Status: Member | 3,820 Posts
Quoting Gambler180
Disliked
I would like the EA to check every currency pair while only attached to one chart Here is the code.
Ignored

hey gambler.... little more to it than that, as you have discovered....

the best way is to create a symbol list and then cycle thru it checking each pair.... for(int i=0;i<14;i++)

you must use the market info string..... look here for example.....

//---
in your case , better still would be to encapsulate the entire code in a single function and save the results in a multidemsional array.....

somewhere buried in my attachments should be the entire ea along with dashboard indicator for pinbars and other such formations...... wrote it long ago for someone one the james thread.....h
to trade and code, keep both simple... no call to impress....h
 
 
  • Post #5
  • Quote
  • Jul 20, 2010 3:17pm Jul 20, 2010 3:17pm
  •  Gambler180
  • | Joined Mar 2007 | Status: Member | 756 Posts
Quoting hayseed
Disliked
hey gambler.... little more to it than that, as you have discovered....

the best way is to create a symbol list and then cycle thru it checking each pair.... for(int i=0;i<14;i++)

you must use the market info string..... look here for example.....

//---
in your case , better still would be to encapsulate the entire code in a single function and save the results in a multidemsional array.....

somewhere buried in my attachments...
Ignored
I don't know how to create an array but I have found a solution by looking at another indicator i made last year. The attached indicator checks 32 charts for pinbars. 8 currencies on 4 timeframes. As you can see there is a lot of repititive code. I would like to make it shorter but I'm not good at creating functions.
Attached File(s)
File Type: mq4 pin bars.mq4   10 KB | 1,108 downloads
If slaughterhouses had glass walls, everyone would be a vegetarian!
 
 
  • Post #6
  • Quote
  • Jul 20, 2010 3:51pm Jul 20, 2010 3:51pm
  •  Gambler180
  • | Joined Mar 2007 | Status: Member | 756 Posts
How would the code look like if I make it shorter instead of writing 4 if commands for each currency pair(one if command for each time frame)?
If slaughterhouses had glass walls, everyone would be a vegetarian!
 
 
  • Post #7
  • Quote
  • Jul 20, 2010 11:38pm Jul 20, 2010 11:38pm
  •  Gambler180
  • | Joined Mar 2007 | Status: Member | 756 Posts
I found a smart way to do it.
Attached File(s)
File Type: mq4 1pinbar.mq4   2 KB | 1,679 downloads
If slaughterhouses had glass walls, everyone would be a vegetarian!
 
 
  • Post #8
  • Quote
  • Last Post: Apr 18, 2018 11:30am Apr 18, 2018 11:30am
  •  T4Trade
  • Joined Sep 2017 | Status: Trend Following,Price Action,Grid | 2,272 Posts
this pinbar is not working it seems,im looking for multitimeframe pinbar,lets say 4 hour pinbar appeared on 1 hour chart,please if someone has got it,please share,thanks!
 
 
  • Platform Tech
  • /
  • Simple pinbar EA
  • Reply to Thread
0 traders viewing now
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2023