| stevehopwoodforex.com https://www.stevehopwoodforex.com/phpBB3/ Print view |
|
| EA request Heiken Ashi https://www.stevehopwoodforex.com/phpBB3/viewtopic.php?t=3263 |
Page 7 of 17 |
| Author: | TraderDesk [ Sun Nov 17, 2013 8:34 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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.. 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... 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. 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"... |
|
| Author: | TraderDesk [ Sun Nov 17, 2013 9:09 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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... 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. |
|
| Author: | TraderDesk [ Mon Nov 18, 2013 11:55 am ] |
| Post subject: | Re: EA request Heiken Ashi |
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... 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. 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... |
|
| Author: | milanese [ Mon Nov 18, 2013 12:10 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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 |
|
| Author: | milanese [ Mon Nov 18, 2013 1:03 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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 |
|
| Author: | TraderDesk [ Mon Nov 18, 2013 2:15 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
Hi... trying out the EA with the settings 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... Also check the test.set file above. I export it to save it and this is what it shows me... Thanks, |
|
| Author: | milanese [ Mon Nov 18, 2013 2:28 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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 |
|
| Author: | TraderDesk [ Mon Nov 18, 2013 2:32 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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... |
|
| Author: | milanese [ Mon Nov 18, 2013 2:39 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
Ok this one handels each tick I hope it will now work as you wanted.. Cheers Tommaso |
|
| Author: | TraderDesk [ Mon Nov 18, 2013 2:58 pm ] |
| Post subject: | Re: EA request Heiken Ashi |
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... |
|
| All times are UTC | Page 7 of 17 |
|
Powered by phpBB® Forum Software © phpBB Limited |
|