| New signals service! | |
|
|||||||
| Register in Forex TSD! | |
|
Trading Systems Leaders in this forum (automated trading systems) are winning more than 3000 pips in a month (30000$ investing one lot every time). Click here to register and get more information |
|
![]() |
|
|
LinkBack | Thread Tools | Display Modes |
|
|||
|
Hello fellow coders!!!
I have HUGE PROBLEMS FOR > 10 DAYS!! 1) First problem : extern double StartHour, StartMinute; extern double line; int start() { //---- if (TimeHour (TimeCurrent()) == StartHour) { if (TimeMinute (TimeCurrent()) == StartMinute) { line = Bid; Print ("Newer ", "line is ", line, "Bid is ", Bid); //if (Bid > line + 12* Point) //LINE 1 //{ //Print ("The bid is 12 points bigger then the previous bid"); //} //LINE 4 } } //---- return(0); } The program was printing “Newer” until LINE 1 - LINE 4 were added. After this, I ran the program again, the inputs were loaded, it was initialized, and no any printing. Then, LINE1-LINE4 were blocked with // and again no printing. What is the problem? 2) Second problem : Other programs during 1 week were working and then suddenly stopped working. Nothing was changed. Again, I created a new program of the same type. And, again it works for a certain period of time and then stops working. All the time, the program becomes dead after a short period of time. No output printing, nothing!!! What is this???? 3) Third problem : Another problem for the previous week., a program was coded. I ran the program and the output said, for example, “A” printing. I deleted Print (“A”) code; and typed instead Print (“B”); but on the program run it was printing A. I do compiling after any change in the coding. I suspect that someone purposely gave me a certain code that sets a bug to every new EA that I create!!!!!!!!!!!!! They do this on purpose that at the end to ask for money that I don’t have. Is there any other way to solve the problem except formatting the hard drive? Please, HELP!!!! |
|
|||
|
I have some questions, if You don't mind coders....
PHP Code:
Can You please just do the //comments, and PLEASE explain each line for me please, I want to be able to understand each line ![]() |
|
|||
|
Quote:
My advise is that for every word you write, check the help file of Mql4 (you must know, it's your name ...) For sample : "extern double StartHour, StartMinute; ... if (TimeHour (TimeCurrent()) == StartHour)" Mql4 : int TimeHour( datetime time) Returns the hour for the specified time. you compare a double with an int, this doesn't work, you have to declare StartHour as int. If you have the assignation statement "line = Bid;", your imediatelly following test "if (Bid > line + 12* Point)" will never be true. in place of "TimeHour (TimeCurrent())" you can also use "Hour()" So "Is there any other way to solve the problem except formatting the hard drive?" Yes, just learn a little bit more. |
|
|||
|
Thank You Michel,
I agree with You. Also, I modified everything, can You please check it, and change mistakes??? At 12:30 it is to set a buystop 10 pips above the current price, and set a sellstop 10 pips below the current pirce. PHP Code:
|
|
|||
|
New, Fresh Questios
1)What is the code to have a comment at the bottom left corner a certain color, and font, and font size? For example, I want the comment to say: Good Day being blue colored, Papyrus font, 10 size font.
2)If I have, for example 5 orders open, I what is the code to close, for example, the 1st order, not all of them? 3)Are there codes for milliseconds, or even smaller? 4)If I bought, for example, I want a trailingstop 2 pips under each low of a new bar. Thank You, MQL4. |
|
|||
|
Make sure you use prefix such as "pbstat", so you can use another function to delete them in deinit()
Code:
void objectCreate(string name,int x,int y,string text="-",int size=42,
string font="Arial",color colour=CLR_NONE)
{
ObjectCreate(name,OBJ_LABEL,0,0,0);
ObjectSet(name,OBJPROP_CORNER,PBCorner);
ObjectSet(name,OBJPROP_COLOR,colour);
ObjectSet(name,OBJPROP_XDISTANCE,x);
ObjectSet(name,OBJPROP_YDISTANCE,y);
ObjectSetText(name,text,size,font,colour);
}
void DeleteAllObjects()
{
int objs = ObjectsTotal();
string name;
for(int cnt=ObjectsTotal()-1;cnt>=0;cnt--)
{
name=ObjectName(cnt);
if (StringFind(name,"pbstat",0)>-1) ObjectDelete(name);
ObjectsRedraw();
}
}
|
![]() |
| Bookmarks |
| Tags |
| automated close order, close, eas, forex, learn mql4, learn mql4 video, mql4 learning, OrderCloseBy, profit, reach, secure profit function, T101_v1.11_orest_IBFXm.mq4, learning mql4 |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Learning Cycles For New Traders | Dan7974 | General Discussion | 350 | 01-18-2008 07:04 PM |
| Learning to code for autotrading | GoatT | Metatrader Programming | 8 | 01-10-2007 09:55 PM |
| Self learning expert | mrtools | Expert Advisors - Metatrader 4 | 32 | 10-22-2006 06:29 PM |