[英]Open a trade when an indicator places an arrow in a chart
Is it possible for an EA to open a trade when an indicator places an arrow on the current candle or a previous candle? 当指标在当前蜡烛或上一个蜡烛上放置一个箭头时,EA是否可以开仓交易? 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 in your example is number of bar (0 - current, 1 - previous one), 0 is the buffer. 您的示例中的1是小节数(0-当前,1-上一个),0是缓冲区。
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. 不要忘记您必须在“我的自定义指标”之后传递所有指标输入,否则您将使用默认设置上传指标,而不是您所需要的。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.