Mql5 code robot for metaeditor


Repl link:

code snippet

In mql5 metaeditor, Define these ROCs as formulated in tradingview:

ROC_fast = roc 8 at 30m time frame

ROC_medium = roc 184 at 30m time frame

ROC_slow = roc 912 at 30m time frame

then write a trading robot code for mql5 metaeditor with the following conditions:

When an open buy position already exists, close it when ROC_medium is less than zero or Roc_slow is less than zero.

When an open buy position does not exist, open a buy position when ROC_fast & ROC_medium & ROC_slow are all greater than zero, with trading volume = 0.01 lot and fixed stop loss = 96% of position price.

Avoid unclarified identifiers and Put conditional expressions into event handler function.

Is this classwork or homework, or a bounty?