In a breakout system you need to capture when the price is above (or below) a price channel or some combination of indicators. For mt5 we have some examples that use an adx or price channel. In the examples, the close price is compared to the price of the channels. In your strategy you have a couple of errors: -You compare bid to a fixed price. You should compare it to an indicator or price level. -Using bid may not be the best option since you trade bars -You trade bars and compare two ma indicator, they have the same period but calculated using the open price and close price. This is ok but you cannot do that comparison in the current bar. If you trade bars, the trading conditions are evaluated when the first tick of the bar is received. This tick is the open price. Your ma conditions are calculating the ma value using the open price (since at open price, open price of bar = close price of bar because the bars is not formed). If your indicators use the close price, most of the time you need to calculate the indicator value in the previous bar (use shift =1)
Last bumped by AlGer on Thu Oct 25, 2012 11:07 am.
|