extern int LevelProfit = 25; // - 盈利水平,以点为单位,必须达到这个水平才能将其止损点转移到盈亏平衡点。
extern int LevelWLoss = 1; // -Breakeven level in points, which stop position will be moved to after its profit reaches the LevelProfit level in points.
double price;
double PriceBuffer[];
int init()
{
SetIndexBuffer(0,PriceBuffer);
return(0);
}
int start()
{
int limit, i;
int counted_bars=IndicatorCounted();
//---- last counted bar will be recountedif(counted_bars>0) counted_bars--;
limit=Bars-counted_bars;
for(i=limit-1; i>=0; i--)
{
PriceBuffer[i] = price;
price = iClose(NULL,0,i);
}
return(0);
}
extern int LevelProfit = 25; // - 盈利水平,以点为单位,必须达到这个水平才能将其止损点转移到盈亏平衡点。
extern int LevelWLoss = 1; // -Breakeven level in points, which stop position will be moved to after its profit reaches the LevelProfit level in points.
在终端挂断(断电)的情况下,保存重要数据/变量的最佳方法是什么?
- 终端的全局变量? 到一个文件?
- 它们需要多长时间被保存一次?(最后的股权值和一些bools是很重要的)
你好!
我不明白为什么我不能修改一个未结头寸,我输入了订单(在订单选择功能中)。
//+------------------------------------------------------------------+亲爱的开发者,有一个问题要问你。
当从专家顾问中调用该指标时,我无法使该指标的全局变量正确工作。
以下是该指标的代码(只有对理解该问题很重要的字符串)。
在每个条形图中,它都将当前价格保存在全局变量price中,并在下一个条形图中显示。因此,我们应该看到价格图表延迟了一个柱状。如果我们把指标附在图表上,一切都会相当顺利。
但是,如果从EA中调用这个指标并进行视觉测试,我们会在测试结束时看到:这个指标只是与它应该有的东西稍微相似。
如果现在我们在视觉测试图上重新计算该指标(例如,打开和关闭其属性),一切都会恢复正常--我们再次看到第一张图片。
我做错了什么?
我做了一个搜索,但没有找到任何答案。
我使用MT4 4.00版Build 226。
你好,请告知代码中哪里不准确,因为当脚本工作时,日志中出现了这样的错误。
15:40:29 11dP_real_symbol EURUSD,H4: <---发现2个正确的图表。--->
15:40:29 11dP_real_symbol EURUSD,H4: <---要看结果,请打开EURUSD,M1002图表--->。
15:40:29 11dP_real_symbol EURUSD,H4: MarketInfo函数的符号名称必须是一个字符串
15:40:29 11dP_real_symbol:FileWriteString函数 的空字符串参数
15:40:29 11dP_real_symbol EURUSD,H4: MarketInfo函数的符号名称必须是一个字符串
15:40:29 11dP_real_symbol EURUSD,H4: <---要看结果,打开图表,M1002 --->
15:40:29 11dP_real_symbol EURUSD,H4: WindowHandle函数的第一个参数必须是一个初始化字符串
15:40:30 11dP_real_symbol EURUSD,H4: WindowHandle函数的第一个参数必须是一个初始化的字符串。
15:40:31 11dP_real_symbol EURUSD,H4: WindowHandle 函数 的第一个参数 必须是一个初始化字符串
我在下面附上了代码本身。
在终端挂断(断电)的情况下,保存重要数据/变量的最佳方法是什么?
-终端的全局变量? 到一个文件?
- 它们需要多长时间被保存一次?(最后的股权价值和顾问的一些bools是很重要的)
与其他变量不同,GV变量不仅可以从任何程序中创建,还可以被删除。即使客户终端关闭后,GV变量的值仍然保留在计算机的硬盘上。一旦宣布GV变量存在于客户终端,自最后一次呼叫后的4周内。如果在此期间没有程序访问GV变量,GV变量将被客户终端删除。一个GV变量只能是double类型。
你好!
我不明白为什么我不能修改一个未结头寸,我输入了订单(在订单选择功能中)。
//+------------------------------------------------------------------+15:40:29 11dP_real_symbol EURUSD,H4: <---发现2个正确的图表。--->
15:40:29 11dP_real_symbol EURUSD,H4: <---要看结果,请打开EURUSD,M1002图表--->。
15:40:29 11dP_real_symbol EURUSD,H4: MarketInfo函数的符号名称必须是一个字符串
15:40:29 11dP_real_symbol:FileWriteString函数 的空字符串参数
15:40:29 11dP_real_symbol EURUSD,H4: MarketInfo函数的符号名称必须是一个字符串
15:40:29 11dP_real_symbol EURUSD,H4: <---要看结果,打开图表,M1002 --->
15:40:29 11dP_real_symbol EURUSD,H4: WindowHandle函数的第一个参数必须是一个初始化字符串
15:40:30 11dP_real_symbol EURUSD,H4: WindowHandle函数的第一个参数必须是一个初始化的字符串。
15:40:31 11dP_real_symbol EURUSD,H4: WindowHandle函数的第一个参数必须是一个初始化字符串
我在下面附上自己的代码。
请告诉我 "OP BUY"--预期变量是什么意思?
here while(difference>Span)
(OrderSend(string symbol, OP_BUY, volume, double price, slippage,Bid-stoploss*Point,
Bid+takeprofit*Point, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=Red))
while(0-different>Red)
( OrderSend (string symbol, OP_SELL, volume, double price, slippage,Ask+stoploss*Point,
Ask-takeeprofit*Point, string comment=NULL, string comment=0, int magic=0, datetime expiration=0, color arrow_color=Black) )