CCI Expert, not a holly grail, but quite rewarding - page 9

 

No, metatrader does not backtest in ticks but timeframe bars.

 

I don't like to argue, but...

No if you said metastock (you would be correct).

Metatrader does in fact backtest in ticks which you can easily test by putting a print statement in your expert and see all the ticks that are generated.

 

If you are talking about MT4 then I agree they do backtest with ticks now

 

Now back tot he system, I thoughjt i corrected everything and apparently it only corrected in one way...

https://www.mql5.com/go?link=http://forex1000.com/cnet/trade1.jpg

As you can see the first BUY trade was good and was exactly what I wanted, the candle after the cross. BUT in the sell trade it made the trade on the crossing candle (the one before was at 4.9949). This is really odd because it's basically just the inverse of the buy method. check it out:


AboveCurrent = (CurrentCCI > (Buy_Cross_Point));
AbovePrevious = (iCCI(CCI_Period,1) > (Sell_Cross_Point));
BelowCurrent = (CurrentCCI < (Sell_Cross_Point));
BelowPrevious = (iCCI(CCI_Period,1) < (Buy_Cross_Point));
AbovePrevious2 = (iCCI(CCI_Period,2) > (Sell_Cross_Point));
BelowPrevious2 = (iCCI(CCI_Period,2) < (Buy_Cross_Point));

If TotalTrades < 1 Then

{
If (AbovePrevious2) and (BelowPrevious) and (BelowCurrent) Then
{
SetOrder(OP_SELL,
Lots,
bid,
slippage,
bid+StopLoss*Point,
bid-TakeProfit*Point,
Gold);
Alert("CCI Expert Opened a Sell Trade",".",Symbol);
Exit;
};

If (BelowPrevious2) and (AbovePrevious) and (AboveCurrent) Then
{
SetOrder(OP_BUY,
Lots,
ask,
slippage,
ask-StopLoss*Point,
ask+TakeProfit*Point,
white);
Alert("CCI Expert Opened a Buy Trade",".",Symbol);
Exit;
};
};

Now also if anyone has time how can I limit a "one trade per candle"? If its possible of course...

Please let me know what I can change and add.

Thank you

 

I mean deable ticks, not fractual interpolation ticks (or fake ticks).

 

Both Mt3 & MT4 have one option in backtester that uses ticks. MT4 does a better job and yes it will use actuall ticks (as much as it has).

 

No offend, Shahin, do you know what tick means?

 

Ok, no offense taken. I agree with the following meaning from Investopedia.

Tick

What does it Mean? The minimum upward or downward movement in the price of a security.

Example by Shahin: So in some cases it is a difference between .0001 (1/10000) of price where as in others it is 1/100 like .01.

I hope I am not making anybody upset.

BTW. I don't charge much

 

Gazuz, to allow only 1 trade per candle, replace

If TotalTrades < 1 Then

with

If TotalTrades < 1 And Volume <  10 Then

 
Shahin:
Ok, no offense taken. I agree with the following meaning from Investopedia. Tick What does it Mean? The minimum upward or downward movement in the price of a security. Example by Shahin: So in some cases it is a difference between .0001 (1/10000) of price where as in others it is 1/100 like .01. I hope I am not making anybody upset.

Maybe you are confused Tick with Pip? A pip is a smallest point of a currency pair (E.g. 1 pip of EURUSD = 0.0001, 1 pip of USDJPY = 0.01). Investopedia's definition is right but a bit vague and confusing.

My definition: when the price of a security changes, you will get a new qoute. That's quote is called a tick. For EURUSD, normally there are 10,000 to 20,000 ticks or quotes changed per day.

Reason: