Counting the bars after Moving average crossover

 

Hi all,

I am a newbie to MQ4. I am trying to create an EA that places the order after a few bars from a Moving Average Crossover. I know how to identify the Moving Average crossover. I know how to count the number of bars. But when I combine these two into a single EA I cannot get the expected result. Can anyone help me please?

 

use iBarShift()

 
nashameed: I know how to A. I know how to B. But when I CODE it ...
You have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt (using SRC) and the nature of your problem.
 
SDC 2013.12.12 06:38 #

use iBarShift()

Dear SDC,

The iBarShift() function searches for bar by open time. The function returns bar shift with the open time specified. But my concern is how to count the number of bars after a my concern is hot to count the number of bars after a moving average cross over. Please help me.

 
nashameed: The iBarShift() function searches for bar by open time. The function returns bar shift with the open time specified.But my concern is how to count the number of bars after a my concern is hot to count the number of bars after a moving average cross over. Please help me.
Where is the sample of code you're using to achieve this? If you would like someone to code this for you then try the jobs section.
 
nashameed: But my concern is how to count the number of bars after a my concern is hot to count the number of bars after a moving average cross over.
You know WHEN the cross happened. A iBarShift on the when IS "number of bars after" If the cross was 4 bars ago, how many bars are after? FOUR.