Hi all,
I would like a little help with some code logic. I am trying to build an EA of a system I am looking at but am a little puzzled how to write the logic for Buy and Sell Signals. Here is the Pseudo logic of what I want to turn into MQL:
BUY LOGIC:
Code:
If (MA_1 > MA_2) and (Previous(MA_1 < MA_2)) // A moving average cross mean we have a "GET READY" signal
// Once we have a "GET READY" signal the following conditions need to be true
// in order for the system to create a "BUY_SIGNAL".
// Note: the following conditions do not necessarily have to become true on the exact same bar,
but need to trigger true within + or - 2 bars of the "GET READY" bar.
( CLOSE > MA3 ) // Price closes above a MA
( CCI Crosses above the ZERO line ) // CCI crosses up above zero
( Fast Stochastic crosses above Slow Stochastic ) // Stochastic triggers to the up side
The Sell Logic is just the opposite of the buy logic.
I don't need full EA code just the logic converted to MQL 'IF' and 'LOOP' statements to workout the signal. I think I can figure out the OpenOrder code etc... from many examples already in this thread.
Any help anyone can give would be much appreciated.
Thanks,
Moxy