0
votes

Is it possible for an EA to open a trade when an indicator places an arrow on the current candle or a previous candle? If yes, how? I have an indicator that places an arrow where a trade say a BUY or a SELL can be placed. I know that we use code below to get the values of the signal.

double signal_v = iCustom(Symbol(),PERIOD_M1, "My Custom Indicator", 0, 1);

The indicator in this question places an arrow, and I want to know if there is a way one can tell if an arrow has been placed on the current or previous candle by this specific indicator. I have seen any sample codes so I was asking. Kindly.

1

1 Answers

1
votes

1 in your example is number of bar (0 - current, 1 - previous one), 0 is the buffer.

For sure you will have at least two buffers if arrows are implemented from buffers (easy to check - open chart and delete all objects. if arrows stay there - then indicator has buffers and arrows are based on buffers. Open data window and check the bar that has an arrow - it must have value in some buffer line that is not zero and not empty, you can compare to other bars with no buffers.

Do not forget that you have to pass all indicator inputs after "My Custom Indicator" otherwise you will upload the indicator with default settings, not what you need.