Thank you very much for all the time you took to help me - it helped me, even though a solution was not needed. Just now, after I kept trying for hours, I realized that my original function, that is to say:
If Openpositionprofit > Amount Then Begin
If Fast Crosses Below Slow Then...