IF statement for Buy orders

I am trying to make a buy order with two parameters. So what I am trying to do is I have a slow MA a medium moving MA and a fast MA. I want the buy to happen when the fast MA crosses over both the medium and slow MA. The way I wrote it the buy only happens when the fast MA crosses both the same day and thats not what I want it to be. I though about using an IF statement but I am not quite sure how.

this is what I have for the buy
Buy = cross ( MaFst, MaMed) and cross( MaFst, MaSlw);

You did it right, exactly per your description.
You need to change the description.

For example:
“Fast MA crosses over the medium and fast MA crosses or is above the slow.”

Then:
Buy = cross( MaFst, MaMed) and ( cross( MaFst, MaSlw) OR (MaFst >= MaSlw) );

1 Like