EA request Heiken Ashi

Place your new trading idea here to see if someone can automate it.
Locked
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

milanese wrote:
TraderDesk wrote:
milanese wrote:
Wavegarrick wrote:Watching this thread with great interest. Milanese you are simply suberb!!!!!
thank you , but in reality I shows me that I must learn to read more carefully what traderdesk explains, would be a big saving in time and number of updates :lol:

Cheers and have a great weekend :)

Tommaso
Your doing great and I know this is not easy to program..... :) I am just glad that there are awesome people like you who are willing to help when they can....
Thanks, this is normal :), for that this place exists, and your strategy has woken my interest, looks really with potential..
Here again, ready for the markets open, an update, I worked again out two changes in code logic, hope now the opening part is near what you wanted..

Cheers :)
This strategy works quite well for me trading manually. Problem is markets are not static and always look to find an equilibrium. Cold reality is that the market is always being pushed so what is consider equilibrium today is different tomorrow and how you react changes as well. EA's of today sophistication are not yet capable of reacting in sync.

What we can do is created an EA which I consider more of an expert assistant than adviser.. :D This will help to take some of the trading time that we spend on screen and allow us to focus more on strategies or just doing other things like being with family etc... :)

The first step is to create an EA to get us into the trade. That will be the original trade and then additional trades once we are in a trend.

Another step needed is when to get out of the trade. Their are several ways to do this and we will go over that soon enough.

Once we get the EA or EA's working correctly we can start a new thread under Automated trading systems to go into greater detail using the Heiken Ashi strategy...

Whew!!! That said I will set up the conditions for when we should be opening up an original trade as well as additional trades.

I talk about this before but I just want to make sure that the code will work. Below is a chart that shows price action crossing upwards of the HA line. Color was red and now is blue showing price momentum going UP or Bullish. So the setting to buy are the following:

First scenario:
Original Open Position (Cross(Time) Only) -

DelayTheEntryForXBars=
PriceFromHALine=

Now "DelayTheEntryForXBars=" should mean AFTER Price has crossed above the HA line and close above the HA line that would equal 1 bar. Now if I had DelayTheEntryForXBars=3 AND PriceFromHALine=0 I would expect that if Price has stayed ABOVE the HA line after 3 closed bars the EA would automatically open a new position. Since PriceFromHALine=0 is zero the code should not care where the Price is except that it is ABOVE the HA line for the preceding three bars.

Second scenario:
Original Open Position (Cross(Time) AND Price) -

Price Cross HA Line and wait 2 bars. If Price is within 10 pips of the HA line AFTER 2 bar then open Buy Position. So we need to make sure that Price has Crossed the HA line and waited for 2 bars to close DelayTheEntryForXBars=2 THEN PriceFromHALine=10 must be within 10 pips to open NEW position. This is done so if Price is much higher from the HA line then we do not open a new position with a bad R/R...
scene2.png
Also if the Price after 2 bars is HIGHER than 10 pips it will not open a NEW position BUT let's say 10 bars later it gets within 10 pips I want the EA to open a NEW position. Remember this is still a NEW position NOT an ADDITIONAL position as no position has been opened since the cross-over. So no matter how many bars closed the original PriceFromHALine=10 applies until the condition is met.
scene2a.png
Variables included:
DelayTheEntryForXBars=
PriceFromHALine=


This code is just for opening NEW positions via Cross(Time) AND Price. The next post will be about "Additional Positions"...
You do not have the required permissions to view the files attached to this post.
TraderDesk
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

Scenario:
Additional Open Positions (Cross(Time) AND Price) -

DelayFromNewEntryForXBars=
DelayTheAdditionalEntryForXBars=
AdditionalTPriceFromHALine=


Now we have additional positions to look at. After a NEW position is open I want to be able to say after 6 closed bar if Price comes back within 5 pips OPEN an Additional position. Then I want to say ONLY open a second or third or fourth and so on Additional positions spaced apart by at LEAST 7 bars.

So I guess the variables could look like this:

DelayFromNewEntryForXBars=6
AdditionalTPriceFromHALine=5
DelayTheAdditionalEntryForXBars=7


Of course we need to limit the AMOUNT of Additional positions that can be open as well so MaxAdditionalPositions= will limit the amount. This will be a hard limit...
additionalpositions.png
Once we can get this working with the EA then we can look at stop-losses as well as making sure we enter into the larger trends when Trend following.
You do not have the required permissions to view the files attached to this post.
TraderDesk
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

Another very important function the EA needs to do is to look at higher time-frames to determine the bigger trend. This will allow the EA to open NEW and Additional positions on the lower time-frame in the same direction of the bigger trend.

Example: The EA is opening positions on the 5 minute time-frame but will check the 30 minute time-frame to make sure where Price is relative to the 30 minute HA line...
30minutechart.png
Since the 30 minute chart shows Price to be below the 30 minute HA line then no positions should be open when on the 5 minute Price goes ABOVE the HA line.
5minutechart.png
This keeps the emphasis on going with the bigger trend and helps to us in the profit.

The EA should be able to look at least one time-frame greater than the one it will open positions in. So if the EA is opening positions in the 5 minute chart there should be a variable called "xxxxx" pointing to the 15,30,1,4,daily,weekly,monthly time-frames. It would be nice if we can include more than one time-frame like 30 AND 4 hour time-frame but if it is better to start with one time-frame then that is okay for now.

There should also be a variable to turn this ON/OFF... This can be because of counter-trend strategies to be used as well...

Is this doable Tommaso? By the way can you look at the last version of the EA you created and see if you can add the variable DelayFromNewEntryForXBars= as I explain a few posts up when you get the chance? Thanks...
You do not have the required permissions to view the files attached to this post.
TraderDesk
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Re: EA request Heiken Ashi

Post by milanese »

TraderDesk wrote:Another very important function the EA needs to do is to look at higher time-frames to determine the bigger trend. This will allow the EA to open NEW and Additional positions on the lower time-frame in the same direction of the bigger trend.

Example: The EA is opening positions on the 5 minute time-frame but will check the 30 minute time-frame to make sure where Price is relative to the 30 minute HA line...
30minutechart.png
Since the 30 minute chart shows Price to be below the 30 minute HA line then no positions should be open when on the 5 minute Price goes ABOVE the HA line.
5minutechart.png
This keeps the emphasis on going with the bigger trend and helps to us in the profit.

The EA should be able to look at least one time-frame greater than the one it will open positions in. So if the EA is opening positions in the 5 minute chart there should be a variable called "xxxxx" pointing to the 15,30,1,4,daily,weekly,monthly time-frames. It would be nice if we can include more than one time-frame like 30 AND 4 hour time-frame but if it is better to start with one time-frame then that is okay for now.

There should also be a variable to turn this ON/OFF... This can be because of counter-trend strategies to be used as well...

Is this doable Tommaso? By the way can you look at the last version of the EA you created and see if you can add the variable DelayFromNewEntryForXBars= as I explain a few posts up when you get the chance? Thanks...
Yes, first I will add the DelayFromNewEntryForXBars, the htf is too possible and I will add it later if we have stable version ..

Cheers :)

Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Re: EA request Heiken Ashi

Post by milanese »

Ok here is the latest one..
I added DelayFromNewEntryForXBars and DelayReEntryForXBars so we have to the possibility to delay a reentry if wished ..

Cheers :)

Tommaso
You do not have the required permissions to view the files attached to this post.
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

milanese wrote:Ok here is the latest one..
I added DelayFromNewEntryForXBars and DelayReEntryForXBars so we have to the possibility to delay a reentry if wished ..

Cheers :)

Tommaso
Hi... trying out the EA with the settings set
test.set
It does not seem to be working correctly. When there is a crossover I have it set to open position after close of 1 car. I have PriceFromHALine=0 so it should just open no matter what the price...
EAMmistake.png
Also check the test.set file above. I export it to save it and this is what it shows me...

Thanks,
You do not have the required permissions to view the files attached to this post.
TraderDesk
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Re: EA request Heiken Ashi

Post by milanese »

TraderDesk wrote:
milanese wrote:Ok here is the latest one..
I added DelayFromNewEntryForXBars and DelayReEntryForXBars so we have to the possibility to delay a reentry if wished ..

Cheers :)

Tommaso
Hi... trying out the EA with the settings set
test.set
It does not seem to be working correctly. When there is a crossover I have it set to open position after close of 1 car. I have PriceFromHALine=0 so it should just open no matter what the price...
EAMmistake.png
Also check the test.set file above. I export it to save it and this is what it shows me...

Thanks,
I think this is caused thatthe bot not checked each tick, I programmed to wait always for closed candels, you want the bot work in each tick mode?

Cheers :)
Tommaso
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

milanese wrote:
TraderDesk wrote:
milanese wrote:Ok here is the latest one..
I added DelayFromNewEntryForXBars and DelayReEntryForXBars so we have to the possibility to delay a reentry if wished ..

Cheers :)

Tommaso
Hi... trying out the EA with the settings set
test.set
It does not seem to be working correctly. When there is a crossover I have it set to open position after close of 1 car. I have PriceFromHALine=0 so it should just open no matter what the price...
EAMmistake.png
Also check the test.set file above. I export it to save it and this is what it shows me...

Thanks,
I think this is caused thatthe bot not checked each tick, I programmed to wait always for closed candels, you want the bot work in each tick mode?

Cheers :)
Tommaso
Is it a problem to do it for each tick? If not then lets do it as I want to simulate the market as much as possible. If it is too much a problem then we can stick with the end of candle...
TraderDesk
User avatar
milanese
TechAdmin
Posts: 3293
Joined: Wed Jan 09, 2013 9:02 am
Location: btr rdx, r8 +

Re: EA request Heiken Ashi

Post by milanese »

Ok this one handels each tick I hope it will now work as you wanted..

Cheers :)

Tommaso
You do not have the required permissions to view the files attached to this post.
Global Prime is the official SHF broker :yahoo:
Searching for Servers and Workstations with individual configuration?
Just PM
:smile: Click here to go to the BoardKnowledgeBase
NOTE: Cookies and JavaScript are required for the using the board, with full functionality
TraderDesk
Trader
Posts: 479
Joined: Wed Nov 16, 2011 2:12 pm
Location: Estonia

Re: EA request Heiken Ashi

Post by TraderDesk »

milanese wrote:Ok this one handels each tick I hope it will now work as you wanted..

Cheers :)

Tommaso

Getting there... thanks...

I noticed that when it hits a stop-loss as you see in the picture to the left. It opened a sell and price went up and hit the SL. Since then it did not open any more positions even when it crossed down and crossed back up...
stoploss1.png
You do not have the required permissions to view the files attached to this post.
TraderDesk
Locked

Return to “Ideas for Possible Automation”