Forex Factory
  • Login

  • Username: Password:
  • 12:08am

  • Search
  • Home

  • Forums

  • Trades

  • Calendar

  • News

  • Market

  • Brokers

Options

Search

Subscribe to Thread

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

Beyond the Candles 1264 replies

EA with Candles 3 replies

Candles- What do they mean 5 replies

MA Candles 1 reply

I need more candles! 4 replies

  • Platform Tech
  • /
  • Reply to Thread
  • 1

EA using candles

  • Post# 1
  • Quote
  • First Post: Jan 7, 2010 12:25am
  • sebastionay
    Joined Nov 2009 | 332 Posts | Status: Member
Basic question but I have almost no knowledge of mql4 yet.

I'm Interested in making an EA in future which would incorporate candles for Entries and more importantly trend changes, exit signals and exits. Would I need to use mathematical modelling for this or is it more simple than that?

Regards Seb.
The greatest force on earth is compound interest.
  • Post# 2
  • Quote
  • Jan 7, 2010 3:25am
  • n.forex
    Joined Nov 2009 | 14 Posts | Status: Member
Hi

The candles in mql4 contain of (close , high, low ,open,volume)

For current candle:
Inserted Code
Close[0]
High[0]
Low[0]
Open[0]
Volume[0]
For last candle :

Inserted Code
Close[1]
High[1]
Low[1]
Open[1]
Volume[1]
For candle before last

Inserted Code
Close[2]
High[2]
Low[2]
Open[2]
Volume[2]
For example :
Enter buy if the current high more than the last high

Inserted Code
if(High[0]>High[1]){
// we will write the rest of the code
}
  • Post# 3
  • Quote
  • Jan 7, 2010 3:35am
  • sebastionay
    Joined Nov 2009 | 332 Posts | Status: Member
Thanks where is this exactly? And I mean I want to make an EA that recognises specific candle types and formations such as stars,hammers,doji,engulfing and so on.
The greatest force on earth is compound interest.
  • Post# 4
  • Quote
  • Jan 7, 2010 4:08am
  • n.forex
    Joined Nov 2009 | 14 Posts | Status: Member
Quoting sebastionay
Thanks where is this exactly? And I mean I want to make an EA that recognises specific candle types and formations such as stars,hammers,doji,engulfing and so on.
You will write that code in MetaEditor in Metatrader into (int start(){})
Inserted Code
int start()
  { 
  
if(High[0]>High[1]){
// we will write the rest of the code
}
  return(0);
  }
For hammers and stars and other formations like these candles in the picture below you will write the condition in equation like this


for candle number 1
Inserted Code
if(((Close[1]-Open[1])*2) < (Open[1]-Low[1]) &&( (High[1]-Close[1])<(Close[1]-Open[1]))){

// write open buy code here

}
Attached Image
File Type: bmp 0.bmp   576 KB | 304 downloads
  • Post# 5
  • Quote
  • Jan 7, 2010 2:52pm
  • tommbstone
    Joined Dec 2009 | 575 Posts | Status: Member
Quoting sebastionay
Thanks where is this exactly? And I mean I want to make an EA that recognises specific candle types and formations such as stars,hammers,doji,engulfing and so on.
and if those formations could be progrmamed into ea or indicator that alerts or trades them at the top and bottom of trends or pull backs/reversals would be great but I don't think a computer can do that.
  • Post# 6
  • Quote
  • Jan 7, 2010 7:07pm
  • CodeMeister
    Joined Sep 2009 | 1,392 Posts | Status: Making Code While Making Pips
Quoting tommbstone
and if those formations could be progrmamed into ea or indicator that alerts or trades them at the top and bottom of trends or pull backs/reversals would be great but I don't think a computer can do that.
If you think in terms of an indicator, you can do something useful. Just realize that the human will out perform the computer in most cases. But instead of staring at a screen waiting for something to happen, the computer can be used to screen all pairs looking for the desired pattern. Then the human can take over and make a trade or not.

In terms of an EA or robot, I won't say its impossible, but it is very challenging.
  • Post# 7
  • Quote
  • Jan 7, 2010 11:41pm
  • Ronald Raygun
    Joined Jul 2007 | 4,248 Posts | Status: 22 y/o Investor/Trader/Programmer
The problem with programming a computer to look for patterns is the simple fact that chart patterns which look identical to us do not look identical to a computer.
  • Post# 8
  • Quote
  • Jan 8, 2010 12:05am
  • andante9
    Joined Feb 2008 | 519 Posts | Status: Determined.
Quoting sebastionay
Basic question but I have almost no knowledge of mql4 yet.

I'm Interested in making an EA in future which would incorporate candles for Entries and more importantly trend changes, exit signals and exits. Would I need to use mathematical modelling for this or is it more simple than that?

Regards Seb.
Check out this link for a free EA generator. http://eatbuilder.com/
  • Post# 9
  • Quote
  • Last Post: Jan 9, 2010 2:19am
  • tommbstone
    Joined Dec 2009 | 575 Posts | Status: Member
an indicator may work but not a ea i agree
Thread Tools Search this Thread
Show Printable Version Show Printable Version
Email This Thread Email This Thread
Search this Thread:

Advanced Search

  • Platform Tech
  • /
  • EA using candles
  • Reply to Thread
0 traders viewing now

©2013 Forex Factory, Inc. / Terms of Use / Privacy Policy

Forex Factory® is a registered trademark.

Connect

  • Facebook
  • Twitter
  • RSS

Company

  • About FF
  • FF Blog
  • Careers at FF
  • Advertising
  • Contact FF

Products

  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer

Website

  • Homepage
  • Search
  • User Guide
  • Member List
  • Online Now
  • Report a Bug