Bid/Ask Spread Expert Signal

 

Hi folks!

Newbie comes again...

My next task is to build an include file (mqh) to use with expert advisor (generate). It is an expert signal based solely on bid/ask spread (BAS, for convenience), based on ticks. So, if the current BAS is higher than the last three ones, it is a no go. Or it least should be lower than or equal to the smallest of the last three ones. For example:

Bid/Ask Spread:

9 -> store to BASarray[0]

8 -> store to BASarray[1]

10 -> store to BASarray[2]

BufferArray = ArrayCopy(BASarray,BufferArray)

ArraySort(BufferArray)

MinSpread = BufferArray[0]

MedSpread = BufferArray[floor(ArraySize(BufferArray)/2)]

MaxSpread = BufferArray[2]

New tick, new BAS, let's say 11

If NewBAS <= MinSpread

   position.open()

Does this already exists? I think this could be a great addition to the standard library of MT5, ready for generate new experts with the Wizard, since Bid/Ask spread impacts heavily on exchange deals entry (open, direction in).

Many thanks!

 
Arthur Albano:

Hi folks!

Newbie comes again...

My next task is to build an include file (mqh) to use with expert advisor (generate). It is an expert signal based solely on bid/ask spread (BAS, for convenience), based on ticks. So, if the current BAS is higher than the last three ones, it is a no go. Or it least should be lower than or equal to the smallest of the last three ones. For example:

Bid/Ask Spread:

9 -> store to BASarray[0]

8 -> store to BASarray[1]

10 -> store to BASarray[2]

BufferArray = ArrayCopy(BASarray,BufferArray)

ArraySort(BufferArray)

MinSpread = BufferArray[0]

MedSpread = BufferArray[floor(ArraySize(BufferArray)/2)]

MaxSpread = BufferArray[2]

New tick, new BAS, let's say 11

If NewBAS <= MinSpread

   position.open()

Does this already exists? I think this could be a great addition to the standard library of MT5, ready for generate new experts with the Wizard, since Bid/Ask spread impacts heavily on exchange deals entry (open, direction in).

Many thanks!

what's the point of entering a trade based on spread decrease ?
you know spread can be widened/squeezed in both direction ?

 
Code2219 or probably 2319:

what's the point of entering a trade based on spread decrease ?
you know spread can be widened/squeezed in both direction ?

Trading basics: when you enter, you automatically loose the bid/ask spread. Also, it is not a full EA. It is only an Expert Signal to be combined with other Expert Signal (MACD, MA, etc.) to generate new Expert Advisors. Therefore, it could be part of a strategy.