Assistance witrh EA, Indicator code adjustment.

 

Hi everyone,

I am trading using the attached indicator, when a sell signal is triggered I buy, and vice versa. It works strangely enough. I would like to surn this indicator into an EA, would someone be able to help me adjust the code, instead of printing the signal and setting of an alarm I would like it to open an order on the open of the next bar. For example:


Sell signal triggered: OrderSend(Symbol(), OP_BUY, lots * 2, Bid, 3, // at the open of the next bar


Buy signal triggered: OrderSend(Symbol(), OP_BUY, lots * 2, Bid, 3, // at the open of the next bar


if there is a position open it is reversed when the opposing signal is triggered. if no position trade as above. If a position is open and another signal is triggered in the same direction, ignore.


To someone who knows what they are doing I guess it would take then a few min to adjust the code, I have been trying now for days and its driving me crazy. Please can someone help me out. It would be greatly appreciated.

 

I have managed to make a start but as I am very new to coding I have problems. Can someone enplane how I can code the above with an option to reverse at alternate signal?


Thanks for your help in advance

Files:
tester.mq4  2 kb
Reason: