Hi,
I like to write my own EAs even though my coder skills are very basic. I never worked before with libraries and I'm having troubles to understand how to code my EA.
What I want to do is to get the signals from the HGI library and then define:
Buy conditions - Up trend arrow or blue wave under the bar
Stop Buy - Down trend arrow or blue wave above the bar
Sell conditions - Down trend arrow or blue wave above the bar
Stop sell - Up trend arrow or blue wave under the bar
Tighten Stop loss Buy - yellow wave above the bar
Tighten Stop loss Sell - yellow wave under the bar
I have attached my EA code if you want to see the rest of my strategy (MM, SL and TP)
So, the 1 million dollar question is: How can I get the signals out of the HGI library?
Thank you,
JFonseca
Simple HGI EA - help needed
-
JFonseca
- Trader
- Posts: 25
- Joined: Thu Jul 26, 2012 9:50 am
Simple HGI EA - help needed
You do not have the required permissions to view the files attached to this post.
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Simple HGI EA - help needed
just take a look to at exp. ----> http://www.stevehopwoodforex.com/phpBB3 ... =87&t=4009 v 1.04 uses the hgi_lib and gives you a coding exampel, to the HGI_matrix in the L versions uses the hgi-lib, so you find some coding exampels how to use the lib..
Cheers
Tommaso
Cheers
Tommaso
Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
JFonseca
- Trader
- Posts: 25
- Joined: Thu Jul 26, 2012 9:50 am
Simple HGI EA - help needed
I think I got it:
With this I get the most recent HGI signal for the last 10 bars. If it finds a trend arrow or a blue wave stops looking for older signals. Is this correct?
TradeHGI_Slope = 2 is a yellow wave under the bar and TradeHGI_Slope = 1 is a yellow wave above the bar. Is this correct?
Code: Select all
TradeHGI_Signal = 0;
TradeHGI_Slope = 0;
for(int i=1; (i <= 10) ;i++)
{
TradeHGI_Signal = getHGISignal(S,PERIOD_H4,i);
TradeHGI_Slope = getHGISlope (S,PERIOD_H4,i);
if (TradeHGI_Signal == 1 || TradeHGI_Signal != 2) break;
if (TradeHGI_Slope == 3 || TradeHGI_Slope != 4) break;
}
TradeHGI_Slope = 2 is a yellow wave under the bar and TradeHGI_Slope = 1 is a yellow wave above the bar. Is this correct?
- milanese
- TechAdmin
- Posts: 3293
- Joined: Wed Jan 09, 2013 9:02 am
- Location: btr rdx, r8 +
Simple HGI EA - help needed
yes as you see in the hgi_lib.mqh..JFonseca » Thu Jan 15, 2015 11:37 pm wrote:I think I got it:
...
TradeHGI_Slope = 2 is a yellow wave under the bar and TradeHGI_Slope = 1 is a yellow wave above the bar. Is this correct?
Code: Select all
//+------------------------------------------------------------------+
//| hgi_lib.mqh |
//| http://www.stevehopwoodforex.com/ |
//| This library was developed by milanese from the |
//| http://www.stevehopwoodforex.com/ forum. |
//+------------------------------------------------------------------+
#property copyright "milanese"
#property link "http://www.stevehopwoodforex.com/"
#property version "1.00"
#property strict
#import "hgi_lib.ex4"
enum SIGNAL {
NONE=0,
TRENDUP=1,
TRENDDN=2,
RANGEUP=3,
RANGEDN=4,
RADUP=5,
RADDN=6 };
enum SLOPE {
UNDEFINED=0,
RANGEABOVE=1,
RANGEBELOW=2,
TRENDABOVE=3,
TRENDBELOW=4 };
SIGNAL getHGISignal( string symbol, int timeframe, int shift );
SLOPE getHGISlope( string symbol, int timeframe, int shift );Global Prime is the official SHF broker 
Searching for Servers and Workstations with individual configuration?
Just PM
Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
Searching for Servers and Workstations with individual configuration?
Just PM
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
-
JFonseca
- Trader
- Posts: 25
- Joined: Thu Jul 26, 2012 9:50 am
Simple HGI EA - help needed
Thank you for your help.
I will start forward testing in Demo next week
EA removed because has a bug!
I will start forward testing in Demo next week
EA removed because has a bug!
Last edited by JFonseca on Tue Jan 20, 2015 9:54 pm, edited 1 time in total.
-
JFonseca
- Trader
- Posts: 25
- Joined: Thu Jul 26, 2012 9:50 am
Simple HGI EA - help needed
Hi,JFonseca » Fri Jan 16, 2015 1:06 am wrote:Thank you for your help.
I will start forward testing in Demo next week
I found a minor issue Which could in some instances not send the TP.
Here is the fixed version.
EA removed because has a bug!
JFonseca
Last edited by JFonseca on Tue Jan 20, 2015 9:54 pm, edited 1 time in total.
-
beorne
- Trader
- Posts: 31
- Joined: Wed Jul 04, 2012 9:08 pm
- Location: Portugal
Simple HGI EA - help needed
Thanks for sharing.
I'll try to set it up on a new demo today and publish a Myfxbook link.
Cheers,
b.
I'll try to set it up on a new demo today and publish a Myfxbook link.
Cheers,
b.
-
JFonseca
- Trader
- Posts: 25
- Joined: Thu Jul 26, 2012 9:50 am
Simple HGI EA - help needed
To use this EA make sure that you have hgi_lib.mqh placed into the \Include folder of your Empty4 installation and hgi_lib.ex4 into \Libraries: These 2 files give the EA the HGI signals and were coded by Milanese.
You do not have the required permissions to view the files attached to this post.
-
beorne
- Trader
- Posts: 31
- Joined: Wed Jul 04, 2012 9:08 pm
- Location: Portugal
Simple HGI EA - help needed
Yes, thanks, I figured I needed the libraries.
Here's the link to myfxbook:
http://www.myfxbook.com/members/beorn/shgi/1131085
Cheers,
b.
Here's the link to myfxbook:
http://www.myfxbook.com/members/beorn/shgi/1131085
Cheers,
b.
- woodlands
- Trader
- Posts: 226
- Joined: Sun Mar 23, 2014 6:16 pm
Simple HGI EA - help needed
I put on a demo on Sunday for opening and is now up 36% today.
The EA is only taking buy trades and placing buy stops (a lot of them).
I cannot see anything in the code comparing buy with sell why this should be so.
This is because I know less than nothing of code I expect but seems to be following the plan.
Thanks
Tony
The EA is only taking buy trades and placing buy stops (a lot of them).
I cannot see anything in the code comparing buy with sell why this should be so.
This is because I know less than nothing of code I expect but seems to be following the plan.
Thanks
Tony
