Hi There!
@miro1360 i think i'm going to challenge your skills...
My broker offers microlots tranding on CFDs like SP500 and Nasdaq. These 2 symbols both move by 0.01 as minimum step and have the same pip value.
This conditions are perfect for a pair (or spread) trading experiment that can be very profitable (because normally most brokers don't allow microlots so you need big margins to match the pip values of 2 CFDs finding the correct trade volumes.. and there are no currencies being so strictly correlated).
So the problem is... to create an EA that can trade this strategy, some measurements are needed and i think i have to create something like a "spread" indicator. At first glance I suppose it's impossible to track the relative movement of 2 symbols which have different prices, but it's possible to do it fixing a certain point in time. The idea is this: Nasdaq moves faster than SP500... so, if i recognize that Nasdaq spreads from SP500 more then the middle value of the last x candles, i open a Nasdaq position toward the mean revertions and the opposite position on the SP500.
My intention is to create a lookback period, to use a cycle to check candles from this period to 1, check the single candles combinations of the 2 symbols (I mean... Symbol A Bull-Symbol B Bull, Symbol A Bear-Symbol B Bear, Symbol A Bull-Symbol B Bear and Symbol A Bear-Symbol B Bull) and then calculate the spread by simple addiction or subtctration of candles close price. (A tick by tick comparison would be better but i think is too complicated to do it).
Once i have a single candle spread i can then add or subtract the value to the next candle spread, depending on the bear/bull combination and which symbol has generated the biggest candle, and then plot these values as positive or negatives horizontal segments or rectangles... like an histogram... Not an easy task but i think i can do it.
The major problem is: once i have these values, how can i tell the EA to recognize a mean spread value for the traced period and to open a position when this value is reached? About this point i'm in a big trouble and i hope someone can suggest me a smart idea!
Thanks!
D.