简体   繁体   English

当指标在图表中放置箭头时,打开交易

[英]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.

相关问题 当另一个交易开放时,我如何取消交易并在特定时间内保持开放交易? - How can I cancel a trade when another is open and keep the open trade for a given duration? 当箭头对象被隐藏时,当在图表上绘制向上/向下箭头时,如何以编程方式识别? - How can I recognise programmatically when an up/down arrow is drawn on a chart when arrow objects are hidden? 为什么当第二个箭头指标出现时 EA 不执行任何操作? - Why is it that when the second arrow indicator shows up the EA doesn't execute anything? 以不同于 EA 在 MQL4 中运行的交易品种进行交易 - Open trade in different symbol than the one the EA runs in MQL4 当指标移到图表上时,我想选择特定的单独 window 进行安装 - When an Indicator is moved on to a chart, I want to choose the specific separate window for the installation 如何在mql4指示器中增加箭头的高度 - How to increase the height of the Arrow in mql4 indicator 如何在所有图表中使用 mql4 绘制箭头? - how to draw an arrow with mql4 in all of the chart? 当我用 mql4 编写的 EA 使用 OrderSend() 下订单时,订单已下达,但未显示在图表上 - When my EA written with mql4 places an order using OrderSend(), the order is placed, but does not show on the chart 如果指标已过期,是否有函数( IndicatorRemove() 就像 ExpertRemove() )从图表中删除指标? - is there a function ( IndicatorRemove() just like ExpertRemove() ) to remove an indicator from chart if an indicator has expired? 我的iCustom指标在EA中的变化比图表更频繁 - My iCustom indicator changes more frequently in EA than chart
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM