Indicators: Optimize cross Moving average - page 2

 
FourX:
tflores:
FourX:

Here is a description and code for avoiding trading in a consolidated market with Moving Average Inidcators.

/en/code/9509

I'm VERY new to programming but interetesd in Moving Averges as well.

I'd like to try your EA with the Consalidations trade lockout once you get it integrated if you are willing to share it.

Regardless, good luck and I hope this helps

Hi, I already made an EA out of it, however it is mostly loosing, so the working title is now "GTA" - Greece Trading Automat (you need a bailout after using it), if you think, you are paying too much taxes, you may give it a try.

I think the idea of forexavatar is good, designing some kind of channel and testing for a breakout. An easier way to avoid consolidation problems may be looking at slower periods like 50/200. Some literatur also recommends creating a band with two MAs, one for the open price and one for the close price.

I'm not sure just exactly what it is that you are refereing to with the 'ForExAvatar'.

I've been accomplishing the same function by measuring the price with an iMA at some (adjustable) point in the previous bar timeFame with an iMA and then I program an adjustable minimum difference between it and the closing price of the current bar before it is allowed to place a new order. I have it so that this miminum pip level can either include the spread or not. These all take place at the very start of a new bar but I have been having trouble with getting the info from the new bar so currently I'm just using the closing prcie of the previous bar right after the new bar starts.

I've been having trouble getting it to open trades consistantly: it keeps truning them on & off for now apperent reason. I also haven't got closing the trades out working properly yet either. Ahhh the joys of a newbe! NOT!

Good luck to all of us!

Hi, with forexavator i mean the autor of the indicator "MaStillWorks". I do not know if it helps because it gives some false signals.

The problem on any cross MA expert advisor is finding a box range (sidwards market). I decided to use my triangles to devide market in small peaces and measurign the minimum and maximum inside the last two triangles (long and short trade trinangles differently) than drawing boxes around or using the information of previous rectangles to optimize trades.

 
Meta1:

I can't upload the mql file. sorry. I don't know why.

You aren't able to upload it to MQL4.Com or Download it onto your own computer ?

 
Meta1:

I can't upload the mql file. sorry. I don't know why.

You are unable to upload a file of your own onto the MQL4.Com?

OR

You are unable to DownLoad a file from the MQL4.Com swerver onto your own computer?

 

It seems the code is not properly done...can anyone attch the code to a chart?

 
ErrorProgrammer:

It seems the code is not properly done...can anyone attch the code to a chart?

Hi,

It is still very experimental and you can crash MT4 with it if you give it too much crossings to optimize (for example fast MA 2..100 and slow ma 10..300). If terminal stalls after putting the indicator on the chart, it takes too much time to calculate, you can increase the step, the minimum/maximum MA ranges and the number of bars to test or simply give it a fixed rate. One idea of optimizeation I have is a mode where it testes standard MA ranges found in the books like 13/50, 21/100.... or a combination of all of them.

 

This MA EA works reasonably well and is profitable as it is.
It is not trading during consolidation periods when it is only trading sideways within a tight range.
http://codebase.mql4.com/en/code/7534

 

IT often repains, how i modify it?

 
simpvest:

IT often repains, how i modify it?


Until now, I was not concerned about optimizing the painting. The idea is to find the last triangle and start working from this point. There will be an update this days.

However the "trading" it shows is only very inacurate because it is based on the median price only. Normally a trader would end a trade if the price hits the line, thus checking each tick not only on each candle. Next step is writing an EA out of it and see if it makes profit.
 
FourX:

This MA EA works reasonably well and is profitable as it is.
It is not trading during consolidation periods when it is only trading sideways within a tight range.
http://codebase.mql4.com/en/code/7534


I found out, that consolidation periods are not that big problem, but fast price movements. On this price movement in EURUSD 1 minute it looses because the MA crosses too late to end the trade in profit. The same can happen in any time frame. Using stop loss is not the solution because stop loss either makes losses if it is too loose or makes the EA not entering in a profitable trade. In this case, Price hits slow MA would have helped to exit the trade.





On the other side, it calculates good values for the consolidation in EURCHF by simply working with two relative slow MAs because this pair has long sidwards periods and a few big movements.

 

Have you ever worked on using the speed of tick? I looked at the speed indicators years ago and your post reminded me of them, back then I was unable to understand how to use them and today I have no idea.



http://www.forex-tsd.com/indicators-metatrader-4/6183-tick-indicator-eas.html


See through the pages into the thread for fixed speed indicators, I loaded them into my MT4 charts and nothing works still. I get the zig zag visual like somone else posted about. I made this post in hope that it may be of some use to you. If speed, trend and basic S/R is incorporated it could be good for an EA after some work. I agree that the management, exit of a trade is very important.



tflores:
FourX:

This MA EA works reasonably well and is profitable as it is.
It is not trading during consolidation periods when it is only trading sideways within a tight range.
http://codebase.mql4.com/en/code/7534


I found out, that consolidation periods are not that big problem, but fast price movements. On this price movement in EURUSD 1 minute it looses because the MA crosses too late to end the trade in profit. The same can happen in any time frame. Using stop loss is not the solution because stop loss either makes losses if it is too loose or makes the EA not entering in a profitable trade. In this case, Price hits slow MA would have helped to exit the trade.





On the other side, it calculates good values for the consolidation in EURCHF by simply working with two relative slow MAs because this pair has long sidwards periods and a few big movements.