Forward looking EA to assist scalping

 

I am stuck!

I have developed a trading system that is sort of working but would greatly benefit from being able to know at what price the system setup will be met.

My thinking is to somehow calculate the price movement necessary to generate the required change in indicator value.

eg: 5 / 8 sma cross. If the 5 and sma are 'x' apart - what change in price would be necessary to generate a cross in the values.

Currenlty I am waiting for the idicators to be alinged and then buying at market (which inevitably is beyond the cross price). If the price at which the sma would cross could be calculated a pending order would assist the system to enter the trade exaclty and thus be more profitable.

Has anyone worked on such a solution? Any ideas?

 

Price Projections

I've developed such a system in VB .NET to calculate the price when the two moving averages cross over. The problem is that in real time the fluctuations in the currency values cause the crossover to succeed and fail multiple times before the bar closes. For example, if the crossover occurs at the bar high and the close falls back, do you have success or failure? If you bought at the high, you may find that the currency has reversed and you never have another solution.

The easiest solution is a binary search, use the current price and one you assume to be over the target solution, calculate your moving averages and determine if the cross over occurred. If you undershoot e.g. the cross did not occur, use the first estimate in place of the current price and pick another higher value for the second until you get a crossover. Then calculate the midpoint between the two estimates and use it in place of the second estimate and try again, you will either get a cross over or will try again using the midpoint and the first estimate. Keep repeating until you get an estimated cross over value less than the pip digit of the currency. Alternatively, you can also try the Newton Rahpeson method to estimate the cross over value.

 

A few beers always help

Hi Tzuman

Thanks for the reply and advise.

I may have a solution though. I was sipping beer and looking at the sea when it stuck me that you could change the indicator code so that once it had completed the iterations to create historic values you could pass your (future looking) values to the indicator and check to see at which price a level is reached.

I am using three indies - CCI, WPR and 2xMVA. (I think) This would be easy enough for the CCI and WPR but more difficult when you are looking for a mva cross.

I am going to try my hand at the easier part puzzle this morning to see if I could get it to work.

What do yo think?

 

Just check my Price Action EA.

Bongo

 

You've got the idea, use the history and then pass future values to it. My outline described how you systematically determine which future value makes the crossover. That being said, you still have the dilemma on determining if the price trend continues past the cross over value and you have a valid signal or if it reverses and goes below it, leaving you without a signal. Its just like 2 moving averages crossovers that whipsaw back and forth except the whipsaw can be tick by tick. By the way, I made a typo, it should be Newton Raphson approximation method as the alternative

 

Indicators

Hmmm....

Not the best coding I am sure - but I have completed the code changes I envisaged. I hard coded the forumlae for the WRP and CCI.

The indicators are set to project high and low values for a 50 point (5 pip) change in price. These are superimposed on the acutal WPR and CCI values.

Any comments.

kcci.mq4

kwpr.mq4

Files:
kcci.mq4  9 kb
kwpr.mq4  9 kb