PDA

View Full Version : EA for quotHeiken Ashi Smoothedquot



cakriku
08:41,
Hello,
can anyone create an EA for the Heiken I Smoothed Indior?

The EA should do the following:
once the candle of the indior is reddish, open a market trade and as soon a green candle shows up, near the market and open a buy trade in the same moment.

When the candle of the indior is green, then open a buy trade and as soon a red candle shows up, close the buy trade and open a market trade in the exact same moment.


So it's always just a single trade open.

No stop reduction, no take profit.

The EA should allow to input the lots you would like to trade.
And it should also automatically raise the lot size, once the balance has improved.

Lets say, you have 10,000$ and need to risk 1 percent of the balance, the EA should automatically trade the corresponding lotsize.
Therefor it should also be possible to enter the most percentage of your balance you would like to risk for the transaction.

The interval does not matter.

Thank's already for any help;--RRB-



https://www.forexsoutheast.asia/attachments/15190435381539775867.mq4

Lauracivilctt
12:45,
Is there a alert to the sdx ie when support or resistance hit
thank you

Lauracivilctt
14:06,
I would be really happy if you could help me with this

I want to use the Heiken I indior (code below) to

1) provide a signal when there is a shaven top or bottom ie the open and high are the same - signal sell (-1) or the open and low are the same - buy signal (1)

2) to Supply this value on the last clossed bar not the current forming bar

Here is the code - thank you very much

#property indior_chart_window
#property indior_buffers 4
#property indior_color1 Red
#property indior_color2 Green
#property indior_color3 Green
#property indior_color4 White
#property indior_width1 1
#property indior_width2 1
#property indior_width3 3
#property indior_width4 3

//--
extern color color1 = Red;
extern color color2 = Green;
extern color color3 = Red;
extern color color4 = Green;
//-- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//--


int ExtCountedBars=0;
// ------------------------------------------------------------------
//| Custom indior initialization function |
//|------------------------------------------------------------------|
int init()

//-- indiors
SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, color1);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, color2);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, color3);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, color4);
SetIndexBuffer(3, ExtMapBuffer4);
//--
SetIndexDrawBegin(0,10);
SetIndexDrawBegin(1,10);
SetIndexDrawBegin(2,10);
SetIndexDrawBegin(3,10);
//-- indior buffers mapping
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexBuffer(3,ExtMapBuffer4);
//-- initialization done
return(0);

// ------------------------------------------------------------------
//| Custom indior deinitialization function |
// ------------------------------------------------------------------
int deinit()

return(0);

// ------------------------------------------------------------------
//| Custom indior iteration function |
// ------------------------------------------------------------------
int start()

double haOpen, haHigh, haLow, haClose;
if(Barslt;=10) return(0);
ExtCountedBars=IndiorCounted();
//-- check for possible errors
if (ExtCountedBarslt;0) return(-1);
//-- last counted bar will be recounted
if (ExtCountedBarsgt;0) ExtCountedBars--;
int pos=Bars-ExtCountedBars-1;
while(posgt;=0)

haOpen=(ExtMapBuffer3[pos 1] ExtMapBuffer4[pos 1])/2;
haClose=(Open[pos] High[pos] Low[pos] Close[pos])/4;
haHigh=MathMax(High[pos], MathMax(haOpen, haClose));
haLow=MathMin(Low[pos], MathMin(haOpen, haClose));
if (haOpenlt;haClose)

ExtMapBuffer1[pos]=haLow;
ExtMapBuffer2[pos]=haHigh;
if (haOpen==haLow)GlobalVariableSet(Sy mbol() HA,1);

else

ExtMapBuffer1[pos]=haHigh;
ExtMapBuffer2[pos]=haLow;
if (haOpen==haHigh)GlobalVariableSet(S ymbol() HA,-1);

ExtMapBuffer3[pos]=haOpen;
ExtMapBuffer4[pos]=haClose;
pos--;

//--
return(0);

// ------------------------------------------------------------------

cristymm
15:27,
Hi OTis

Thanks for sharing this EA. I suppose a candle breakout attribute will issue far better signal/trades. Can u insert such an alternative. U can locate an indior 3line break of google ( I was not able to upload ). I use HA eloquent with this particular indior for guide trades

Regards
Sachin

karenika
16:48,
Here you go Hang Cool. I also suggest the SDX Pivots indior may. It is helpful and I use it everyday. It automatically plots support/resistance, pivots, daily open, yesterdays high and low, Fibonacci levels, etc.. It requires a lot of hassle from trading and can be deadly accurate with Heiken ashi smoothed, RSI, and 50, 100, and 200 MA's. Good Luck. Https://www.forexsoutheast.asia/attachments/1529168134.png sir
I utilize the lonewolf EA of heinka ashi smoothened but it doesn't open the trade I dont know why???
Help I used the same HAS indior still no trade opened why???
thank you

midwlsm87
18:09,
I'd be really happy if you could assist me with this particular

I wish to use the Heiken I indior (code below) to

1) provide a signal whenever there's a shaven top or bottom ie the high and open will be the same - signal sell (-1) or the open and non will be exactly the same - buy signal (1)

2) to provide this value on the last clossed bar not the current forming pub

This is your code - thank you very far

#property indior_chart_window
#property indior_buffers 4
#property indior_color1 Red
#property indior_color2 Green
#property indior_color3... Do you mean this?

Inserted Code #property indior_chart_window #property indior_buffers 4 #property indior_color1 Red #property indior_color2 Green #property indior_color3 Green #property indior_color4 White #property indior_width1 1 #property indior_width2 1 #property indior_width3 3 #property indior_width4 3 //-- extern color color1 = Red; extern color color2 = Green; extern color color3 = Red; extern color color4 = Green; //-- buffers double ExtMapBuffer1#91;#93;; double ExtMapBuffer2#91;#93;; double ExtMapBuffer3#91;#93;; double ExtMapBuffer4#91;#93;; //-- int ExtCountedBars=0; // ------------------------------------------------------------------ //| Custom indior initialization function | //|------------------------------------------------------------------| #91;indent#93;int init() //-- indiors SetIndexStyle(0,DRAW_HISTOGRAM, 0, 1, color1); SetIndexBuffer(0, ExtMapBuffer1); SetIndexStyle(1,DRAW_HISTOGRAM, 0, 1, color2); SetIndexBuffer(1, ExtMapBuffer2); SetIndexStyle(2,DRAW_HISTOGRAM, 0, 3, color3); SetIndexBuffer(2, ExtMapBuffer3); SetIndexStyle(3,DRAW_HISTOGRAM, 0, 3, color4); SetIndexBuffer(3, ExtMapBuffer4); //-- SetIndexDrawBegin(0,10); SetIndexDrawBegin(1,10); SetIndexDrawBegin(2,10); SetIndexDrawBegin(3,10); //-- indior buffers mapping SetIndexBuffer(0,ExtMapBuffer1); SetIndexBuffer(1,ExtMapBuffer2); SetIndexBuffer(2,ExtMapBuffer3); SetIndexBuffer(3,ExtMapBuffer4); //-- initialization done return(0); #91;left#93;#91;/left#93; #91;/indent#93;// ------------------------------------------------------------------ #91;left#93;//| Custom indior deinitialization function | // ------------------------------------------------------------------ int deinit() return(0); // ------------------------------------------------------------------ //| Custom indior iteration function | // ------------------------------------------------------------------ #91;/left#93; #91;indent#93;int start() #91;left#93; double haOpen, haHigh, haLow, haClose; if(Barslt;=10) return(0); ExtCountedBars=IndiorCounted(); //-- check for possible errors if (ExtCountedBarslt;0) return(-1); //-- last counted bar will be recounted if (ExtCountedBarsgt;0) ExtCountedBars--; int pos=Bars-ExtCountedBars-1; while(posgt;=0) haOpen=(ExtMapBuffer3#91;pos 1#93; ExtMapBuffer4#91;pos 1#93;-RRB-/2; haClose=(Open#91;pos#93; High#91;pos#93; Low#91;pos#93; Close#91;pos#93;-RRB-/4; haHigh=MathMax(High#91;pos#93;, MathMax(haOpen, haClose)); haLow=MathMin(Low#91;pos#93;, MathMin(haOpen, haClose)); if (haOpenlt;haClose) ExtMapBuffer1#91;pos#93;=haLow; ExtMapBuffer2#91;pos#93;=haHigh; if (haOpen==haLow)GlobalVariableSet(Sy mbol() HA,1); else ExtMapBuffer1#91;pos#93;=haHigh; ExtMapBuffer2#91;pos#93;=haLow; if (haOpen==haHigh)GlobalVariableSet(S ymbol() HA,-1); ExtMapBuffer3#91;pos#93;=haOpen; ExtMapBuffer4#91;pos#93;=haClose; pos--; #91;b#93;if(ExtMapBuffer1#91;1#93;==ExtMapBuffer3# 91;1#93;-RRB-//Last high = last open#91;/b#93; #91;b#93; Alert(Time to sell);#91;/b#93; #91;b#93;if(ExtMapBuffer2#91;1#93;==ExtMapBuffer4# 91;1#93;-RRB-//Last low = last close#91;/b#93; #91;b#93; Alert(Time to buy);#91;/b#93; //-- return(0); #91;/left#93;#91;/indent#93;

capa38
19:29,
I try Lonewolf (with trailing stop).mq4 to put in the Indikators folder

they dont work why?

Smooth heiken I works. .

please help thx

laqwseavecina
20:50,
I attempt Lonewolf (with tracking stop).mq4 to spend the Indikators folder

they dont work why?

Smooth heiken I works. .

Please help thx Perhaps because its EA not an indior.
Place it in your specialists folder.

capa38
22:11,
Thx Cyber thats it a EA

I have 1 question...

I will exchange in a lower interval without EMA where I must alter the code?

thx

okeixx89
23:32,
I have never used an EA earlier but trade manually with heiken ashi candles and stochs, filtered by 100 SMA on H4

this one seems promising, loading it up to a demo account as we talk, most likely examine H1 or H4


if I were to change this bit of code:


dual MA1 =iMA(NULL,PERIOD_H4,55,0,MODE_EMA,PRICE_OPEN,1);
and substitute 55 using 100 and MODE_EMA using MODE_SMA, would that change the filter for a 100 SMA on H4?

Sorry I am new to mql4

laqwseavecina
00:52,
I have never used an EA before but transaction manually with heiken ashi candles and stochs, filtered by 100 SMA on H4

this one looks promising, loading it up on a demo account as we talk, most likely test H1 or H4


if I were to change this bit of code:



and substitute 55 with 100 and MODE_EMA with MODE_SMA, would this change the filter to be a 100 SMA on H4?

Sorry I'm new to mql4 Yes, simply follow the instructions on line 151 and 160.

taoxra875
02:13,
Hi,

I Have Another problem. I am using the JFD Broker to check the LoneWolf EA on a demo account, however, regardless of what I try, it will not place buys and sells.

My plan was really to change the code in some areas to adapt for my thoughts, but I can't get the unaltered version to work at all. I even replaced my Smooth HA indior from Otis' post. To have an easier time I am using the version and trailing.

I am really at a loss here and any assistance will be appreciated. Thanks in advance.

okeixx89
03:34,
Hello,

I Have Another Issue. I'm using the JFD Broker to test the LoneWolf EA on a demo account, however, no matter what I try, it won't place buys and sells.

My plan was really to change the code in some areas to accommodate to my thoughts, but I can't get the unaltered model to work in any way. I even replaced my Smooth HA indior using the one from Otis' post. Only to get an easier time I'm using the first version without filters and trailing.

I'm really at a loss here and any help will be appreciated.... Me too, I loaded onto a FX Pro demo account but it has yet to activate any transactions. I see the LoneWolf https://www.forexsoutheast.asia/attachments/1529168134.png emblem on the upper corner of the chart so I think the EA is activated and running

karenika
04:55,
Hello,
it didn't open any tradesthe EA is on the green light is on. I did what you instructed but open transactions. . .please look into this. Various men have similar troubles.
Thank you

I created this EA a while back and use it often during trending (non choppy) trading requirements. The EA opens a commerce when when the colour of candle changes color of candle changes and closes. It places trades one after another. I also incorporated take profit, stop loss, breakeven and time management. The EA does well in higher time frames, particularly during trending markets. I could never locate an EA online that used Heiken I Smoothed at a simplistic manner. So here it is. https://www.forexsoutheast.asia/attachments/1529168134.png

Irisota83
06:15,
Hello Traders,

I am new to the forum altogether and that is my very first post:--RRB-

I went back to this lonewolf and made a few alterations.

I altered the open and close states to open at the first and second bar shift, and close at the first or second.

I also gave it a stop loss.

Back analyzed 2 years to the 1 Day timeframe and obtained (too good to be true?) results.

Will you please check it and please tell me it is not too good to be true! :-S

reside testing starting today.
https://www.forexsoutheast.asia/attachments/15291681421568977290.ex4

amarratedui
07:36,
Hello Traders, I'm new to the forum entirely and this is my very first article:--RRB- I went back into this lonewolf and made some alterations. I shifted the open and shut states shut in the first or second, and to open in the first and second pub shift. Additionally, I gave it a stop loss. Back analyzed 2 years to the 1 Day interval and obtained (too good to be true?) results. Can you please check it and please tell me it's not too good to be true! :-starting today testing lives. file you want to offer the mq4 document, otherwise how does developer going to check it.

Irisota83
08:57,
quote you want to offer the mq4 file, otherwise how does programmer about to check it. Sorry I didn't realize I uploaded the ex4. I made some modifications to this entry/exit logic because it slipped.

Thanks,

Bassem
https://www.forexsoutheast.asia/attachments/1529168145217778155.mq4

mal8mn
10:18,
Can this EA be used with a HA chart or only the version?

Eleramm
11:39,
Hi everyone,

Some very interesting remarks on Heiken i.

I've downloaded an indior that shows the closed and open prices onto an Heiken I chart. I'd like to make an expert advisor using using this indior when the lines cross.

Can anyone assist?

Here is the indior for Heiken i.. .

#property indior_chart_window
#property indior_buffers 4
#property indior_color1 Red
#property indior_color2 White
#property indior_color3 Red
#property indior_color4 White
#property indior_width1 1
#property indior_width2 1
#property indior_width3 3
#property indior_width4 3
//--
extern color color1 = Red;
extern color color2 = White;
extern color color3 = Red;
extern color color4 = White;
//-- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
//--
int ExtCountedBars=0;
// ------------------------------------------------------------------
//| Custom indior initialization function |
//|------------------------------------------------------------------|
int init()

//-- indiors
SetIndexStyle(0,DRAW_NONE, 0, 1, color1);
SetIndexBuffer(0, ExtMapBuffer1);
SetIndexStyle(1,DRAW_NONE, 0, 1, color2);
SetIndexBuffer(1, ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE, 0, 2, color3);
SetIndexBuffer(2, ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE, 0, 2, color4);
SetIndexBuffer(3, ExtMapBuffer4);
//--
SetIndexDrawBegin(0,10);
SetIndexDrawBegin(1,10);
SetIndexDrawBegin(2,10);
SetIndexDrawBegin(3,10);
//-- indior buffers mapping
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexBuffer(3,ExtMapBuffer4);
//-- initialization done
return(0);

// ------------------------------------------------------------------
//| Custom indior deinitialization function |
// ------------------------------------------------------------------
int deinit()

//-- TODO: add your code here

//--
return(0);

// ------------------------------------------------------------------
//| Custom indior iteration function |
// ------------------------------------------------------------------
int start()

double haOpen, haHigh, haLow, haClose;
if(Barslt;=10) return(0);
int counted_bars = IndiorCounted();
if(counted_bars lt; 0) return(-1);
if(counted_bars gt; 0) counted_bars--;
int pos = Bars - counted_bars;
if(counted_bars==0) pos-=1 1;
while(posgt;=0)

haOpen=(ExtMapBuffer3[pos 1] ExtMapBuffer4[pos 1])/2;
haClose=(Open[pos] High[pos] Low[pos] Close[pos])/4;
haHigh=MathMax(High[pos], MathMax(haOpen, haClose));
haLow=MathMin(Low[pos], MathMin(haOpen, haClose));
if (haOpenlt;haClose)

ExtMapBuffer1[pos]=haLow;
ExtMapBuffer2[pos]=haHigh;

else

ExtMapBuffer1[pos]=haHigh;
ExtMapBuffer2[pos]=haLow;

ExtMapBuffer3[pos]=haOpen;
ExtMapBuffer4[pos]=haClose;
pos--;

//--
return(0);

https://www.forexsoutheast.asia/attachments/15291681471061666060.mq4

vicpkrst
12:59,
HOW DO I BACK TEST?
Gt; I've got this EA in my LIVE and also a DEMO account and continue 2 days NOT a single trade taken

gt; I attempted to run a egy tester, also comes with ZERO benefits.

AUTO trading is ON GREEN and I have a smily face!
where am i going wrong? I am a bit of a newbie can, on Experts

laqwseavecina
14:20,
HOW DO I BACK TEST? Gt; I have this EA on my LIVE in addition to a DEMO account and 2 days NOT a transaction taken gt; I includes ZERO benefits, also attempted to run a egy tester. AUTO trading is ON GREEN and that I have a smily face! Where am I going wrong? I am a bit of a newbie on Pros, can some please give me an idiots guide to this fxguru2010-
Check the Pros and Journals tab onto the Terminal for any errors.

vicpkrst
15:41,
quote - Check the Experts and Journals tab onto the Terminal for any errors. Thanks so much

vicpkrst
17:02,
quote Sorry I did not know I uploaded the ex4. I made a few modifications as it had been slipping. Thanks, Bassem document Hello Baseem
I have been using this indior for previous 1 week, it looks very impressive, when the trend is still underway, but on sideways market get too many wipsaws.
Can kindly guide me with the following
1) on a chart format will you or some please give me a step by step guide of what criteria is used for ENTRY, ie is it the crossover of price at heiken ashi
two ) I exchange INDICIES like DAX, and Wall street also OIL, the indior works perfectly on FX but so far past week not a single trade taken on INDEX like dax and this is puzzling me.
3) some suggestions on wat filters I can add so that it filters out bad trades and trades only on a tendency
4) any developers out there who want to give it a try?

Thanks Happy Trading

vicpkrst
18:22,
Hi OTis Thank You for sharing this EA. I guess a candle breakout feature will issue. Can insert such an option. U can find an indior 3line fracture of google ( I was not able to upload ). I utilize HA eloquent with this particular indior for guide trades Regards Sachin Thanks Sachin - Is that the attached the one that you use?
Please guide how can you utilize?
https://www.forexsoutheast.asia/attachments/152916811886106989.mq4

vicpkrst
19:43,
quote - Assess the Pros and Journals tab on the Terminal for any Mistakes. Thanks mate
I am running the EA on Indicies ie dax/ftse/dow - no mistakes and not a single commerce

yet when I run it on Forex, I am getting zillion of trades - baffled why it will not do Index

Forex did reside trades on 1 min chart - not good results
5min - therefore
15min average but good profits
30 min - mega profits. Turned into a live account with #100 to #315 in 3 times

is it possible to bring some wipsaw filters on 1 min chart?

I am NOT a programmer, so studying the source file is struggling, but can somebody show me at a chart format what this EA is doing, and once I understand I'm Pleased to add ideas for this

Rttsexxo
21:04,
Can anybody show me the way to conduct the EA?I do backtesting I always get this messages from the journal 2016.06.20 15:01:19.151 2016.01.04 14:29 cannot open file'C:\Users\consumer \AppData\Roaming\MetaQuotes\Root \13740D52A423A096212C1ED8770061FC\MQL4\indiors\Hei ken_i_Smoothed. ex4' [2]

Oxrina
22:25,
Can anyone show me the way to run the EA?I do backtesting I constantly get this messages from the journal 2016.06.20 15:01:19.151 2016.01.04 14:29 can't open file'C:\Users\user\AppData\Roaming\MetaQuotes\Term inal\13740D52A423A096212C1ED8770061FC\MQL4\indiors \Heiken_i_Smoothed. Ex4' [two ]
Try copy file from the article 1 into your indiors folder. I have the same error message also it really helps me.

larumlerSarntto
23:45,
30 min - mega profits. Turned a live account with #100 into #315 in 3 times
Mr FX Guru2010, You employed which currency and which TF to get that excellent profits?

Sensimledrancwza
01:06,
quote Try copy file from the post 1 into your indiors folder. I've got exactly the same error message and I am helped by it. Hi there, will you attempt to elaborate heavier on that please have the Exact Same error messages

saraanctsecaymokcs
02:27,
quote hello, can you try to elaborate deeper on that please I have the identical error messages Use the EA from first post, the very first one submitted by Otis16Keith.

The EA need to update for order purpose.

Sensimledrancwza
03:48,
quote Thanks mate I am running the EA on Indicies ie dax/ftse/dow - without any mistakes rather than a single commerce however when I run it on Forex, I am getting zillion of trades - baffled why it will not perform Index Forex did reside trades on 1 minute chart - not good results 5min - so 15min average but superior profits 30 minutes - mega profits. Turned into a live account into 315 in 3 times with 100 can it be feasible to add several wipsaw filters on 1 minute chart? I am NOT a programmer, so reading the source file is fighting, but can someone show me in a chart format what this EA... hey buddy which particular EA is that, most have been shared here, is it specific. . I want that one about the 30 min chart. thank you

sits
05:09,
Hello, please instructions step by step how to conduct EA and include Heiken I. He's trying in many ways, and EA does not see indyora. I'll be grateful for the aid.

oxrio
06:29,
Hallo,

could anyone make an ea or awake:
it must do the following:

for quick trades: the last 2 bars on the daily chart are red, EMA 14 is pointing down; the price of the first red bar crosses EMA and shuts below along with the 2nd bar breaks the first pubs low.

Would be fantastic!

Soraya.mca
07:50,
I created this EA some time back and use it every so often during trending (non choppy) trading conditions. The EA opens a commerce when when the colour of candle varies color of candle varies and closes. It puts trades after another. I also incorporated take profit, stop time, breakeven and loss management. The EA does well in higher time frames, especially during trending markets. I could never locate an EA online that used Heiken I Smoothed in a simplistic manner. So here it is. Https://www.forexsoutheast.asia/attachments/1529168110.png document file... that exactly waht I want, thank you https://www.forexsoutheast.asia/attachments/1529168110.png

ladartajuancsa
09:11,
I created this EA some time back and use it often during trending (non choppy) trading requirements. The EA opens a commerce when when the color of candle changes, color of candle changes and closes. It puts trades one after another. I incorporated take profit, stop time, breakeven and loss direction. The EA does well particularly in H4 during trending markets. I could never find an EA on the internet that utilized Heiken I Smoothed in a way that is simplistic. So here it is. Https://www.forexsoutheast.asia/attachments/1529168110.png document file... It only puts two transactions on unique pairs Maximum, how do we create it puts trades on multi pairs at the same time?

anaoxrmer
10:32,
Can anybody help to amend the EA that will attempt to open trade when it fails until it manage to open the trade? I faced a problem when it attempt to open a new trade at the open of new candle when the market is near and thus leading not opening any trades. (Error 132).

Another issue I faced is that the changing of prevent loss to breakeven also occur throughout the market close time and therefore not being moved, can anybody help to alter this too?

Thank you very much. Attached the EA already.
https://www.forexsoutheast.asia/attachments/152916812116201786.mq4

jesus8934
11:52,
https://www.forexsoutheast.asia/attachments/1529168124722070126.png
Hello all. Can you please notify me, that which means the values? On Lonewolf-BK-3 they are beginning as a default option. However, what is going to be the difference when I change them? Thanks in advance https://www.forexsoutheast.asia/attachments/1529168111.png