问吧! - 页 37

 

无法到达!我注册了metatrader.info,但我似乎还不能访问。

 

好了,现在明白了....我是编程新手......我不太清楚需要在现有的买入/卖出信号 指标中加入哪部分代码,比如asctrend_sound.mq4中的代码...我得到了编译错误...

 

你好,CG。

我认为函数sleep()只能在EA中调用。是否有任何类似的函数可以在自定义指标 中调用。

 

嘿,编码大师!我看了你的课程,但我没有注意到任何关于使用包含文件的内容。

我看了你的课程,但我没有注意到任何关于使用include文件的内容,这个概念对我来说是新的,我想知道你是否能解释一下我可能在文件上做错了什么,以及如何使用。 也许可以做一个关于include文件的课程?

我所做的工作,(有110个错误?)

//+------------------------------------------------------------------------------------------+

//| Day Off.mq4.mq4 |

//| Eaglehawk |

//| https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html |

//+------------------------------------------------------------------------------------------+

#property copyright "Eaglehawk"

#property link "https://www.forex-tsd.com/suggestions-trading-systems/3191-day-off-safety-detector.html"

//Global Variables

//I used variables to manually put in when Good Friday occurs, (I dont think it's possible to automate cycles of the moon, if you think so, go for it. I am, after all, a newcomer to coding )

extern int GoodFridaysMonth = 4; //Used to see what month Good Friday is in. (either 4 or 5)

extern int GoodFridaysDay = 12; //says the day of the month good friday is on.

bool DayOff = False; // the days interbankfx takes off

bool DayOffClose = False; //operates the last minute close if none of the minimization techniques are met by the deadline

//local variables (both used to determine what trend we are in)

double CurrentClose = iClose(NULL, 0, 1); //looks at the close of the most recent period

double TrendClose = iClose(NULL, 0, 3); //looks at the close of three periods

/*Counts the DayOff Function as true about two days before the time interbankfx is not running, (you can edit this to how fast you think your individual strategy will take to close)

In case this code is tampered with, the dates interbankfx takes off are here

New Years Day January 1

Martin Luther King Jr. Day January 20

Washington's Birthday February 17

Good Friday Friday before Easter

Memorial Day May 26

Independence Day July 4

Labor Day September 1

Thanksgiving Day Fourth Thurday of November

Christmas December 25*/

//DayOff variable tests

if ( Month() == 12 && Day() >= 30 || Month() == 1 && Day() <= 1 ) //New Years Day

{

DayOff = True;

}

if (Month() == 1 && (Day() >= 18 && Day() <= 20)) //Martin Luther King Jr. Day

{

DayOff = True;

}

if (Month() == 2 && (Day() >= 15 && Day() <= 17)) //Washington's Birthday

{

DayOff = True;

}

if (Month() == GoodFridaysMonth && (Day() = GoodFridaysDay - 2)) //Good Friday

{

DayOff = True;

}

if (Month() == 5 && (Day() >= 24 && Day() <= 26)) //Memorial Day

{

DayOff = True;

}

if (Month() == 7 && (Day() >= 2 && Day() <= 4)) //Independece Day

{

DayOff = True;

}

if ( Month() == 8 && Day() >= 30 || Month() == 9 && Day()== 1 ) //Labor Day

{

DayOff = True;

}

if (Month() == 11 && (DayOfWeek() >= 3 && DayOfWeek() =21) //Thanksgiving Day

{

DayOff = True;

}

if (Month() == 12 && (Day() >= 23 && Day() <= 25)) //Christmas Day

{

DayOff = True;

}

//DayOffClose variable tests, currently set to 9:00 P.M.

if (Month() == 12 && Day() == 31 && Hour() == 21) //New Years Day

{

DayOffClose = True;

}

if (Month() == 1 && (Day() == 19 && Hour() <= 21)) //Martin Luther King Jr. Day

{

DayOffClose = True;

}

if (Month() == 2 && Day() == 16 && Hour() == 21) //Washington's Birthday

{

DayOffClose = True;

}

if ( Month() == GoodFridaysMonth && Day() == GoodFridaysDay - 1 && Hour() == 21) //Good Friday

{

DayOffClose = True;

}

if (Month() == 5 && Day() == 25 && Hour() == 21) //Memorial Day

{

DayOffClose = True;

}

if (Month() == 7 && Day() == 3 && Hour() == 21) //Independece Day

{

DayOffClose = True;

}

if (Month() == 8 && Day()== 31 && Hour() == 21) //Labor Day

{

DayOffClose = True;

}

if (Month() == 11 && Day() >=21 && DayOfWeek() <=6) //Thanksgiving Day

{

DayOffClose = True;

}

if (Month() == 12 && Day() == 24 && Hour() == 21) //Christmas Day

{

DayOffClose = True;

}

//these next two functions will minimize loss on long, non-profitable trades before the close of interbankfx

if (DayOff == True && Ask-OrderOpenPrice() 0)

{

TrailingStopMode = True;

}

if (DayOff == True && Ask-OrderOpenPrice() < 0 && CurrentClose - TrendClose < 0)

{

Order = SIGNAL_CLOSEBUY;

}

//these next two functions will minimize loss on short, non-profitable trades before the close of interbankfx

if (DayOff == True && OrderOpenPrice()-Bid <0 && CurrentClose - TrendClose < 0)

{

TrailingStopMode = True;

}

if (DayOff == True && OrderOpenPrice()-Bid 0)

{

Order = SIGNAL_CLOSESELL;

}

//this next function will end all trades if not closed by 9:00 P.M. the day before the close of interbankfx

if (DayOffClose == True)

{

Order = SIGNAL_CLOSESELL;

}

if (DayOffClose == True)

{

Order = SIGNAL_CLOSEBUY;

}

//post this at the end of all your open Logics

if (/*your open logics*/ && DayOff == False) //order open

//post this as one of your exit short logics, closes trades when they are profitable

if (DayOff == True && OrderOpenPrice()-Bid >0)

{

Order = SIGNAL_CLOSESELL;

}

//post this as one of your exit long logics, also closes profitable trades.

if (DayOff == True && Ask-OrderOpenPrice() >0)

{

Order = SIGNAL_CLOSEBUY;

}

//+------------------------------------------------------------------+
 

你好!我想知道我怎样才能获得当前图表窗口的顶部和底部?

是否有一些方法可以获得当前图表窗口的顶部和底部(像素和价格)?

另外,如何在MetaTrader4中通过Widows API创建一个定时器程序?

 

是否可以将.NET DLL用于MT4?

如何使用?

 

如果有更多关于制作指标的信息就更好了,因为EA是基于这些指标的。 Alpari有一些很好的导师,但他们都是俄语。

http://www.alpari-idc.ru/ru/experts/articles/14.html

 

Period_Converter_opt帮助

"我使用这个附在图表上的周期转换器来实时更新自定义图表。这很好用,但如果我打开同一自定义时间框架的多个图表,只有一个图表是实时更新的。其他图表出现在离线状态,只有在刷新菜单选项下才会更新。例如,如果我打开2或3个16M的图表,只有一个图表会有新的点值更新;其他的必须手动刷新。这种限制是设计上的吗?(Period_Converter_Opt)对于这种情况,有什么解决方法吗?建议,有人吗?"

之前在另一个主题上发表过这个问题。关于这个问题有什么想法吗?

干杯。

Diby

 

Period_converter_Opt代码

延伸到以前的帖子。

我简单看了一下代码,我的疑惑是:在以相同的符号和时间框架打开多个窗口的情况下,WindowHandle会返回什么。

if(hwnd == 0) {

//试图检测更新的图表窗口.... 离线窗口

hwnd = WindowHandle(Symbol(), NewPeriod);

}

祝贺你。

Diby

 

买3卖3的跨期脚本或EA - 有吗?

你好,CG和Newdigital,如果你也在的话。

我正在寻找一种EA或脚本,一旦我输入了参数,只需手动输入一个价格水平,就可以在指定的水平上放置SL和TP的上述交易。

本质上是一种跨期交易x 3。

你们知道哪里有这样的东西吗?

谢谢你,问候你。

Ian.