| / | Forum |
|
paulofoxstar
2008.06.24 22:40
How to block an EA to work only in to determine actual I? Example Account: 202020 |
|
Creation of an Automated Trading System You must admit that it sounds alluringly - you become a fortunate possessor of a program that can develop for you a profitable automated trading system (ATC) within a few minutes. All you need is to enter desirable inputs and press Enter. And - here you are, take your ATC tested and having positive expected payoff. Where thousands of people spend thousands of hours on developing that very unique ATC, which will "wine and dine", these statements soundб to put it mildly, very hollow. On the one hand, this really looks a little larger than life... However, to my mind, this problem can be solved. |
|
ukt
2008.06.24 22:54
|
|
paulofoxstar
2008.06.24 23:02
I hold to achieve demo, see my code below .. but could not hold to account for a Real 202020 could help me? int init() |
|
ukt
2008.06.24 23:13
like you do for !IsDemo() can do for account maybe something like this? int liveAccountNumber = 202020; if( AccountNumber() != liveAccountNumber ) { Alert("Account Number not recognized"); return(-1); }not completely clear wants, but is idea... |
|
paulofoxstar
2008.06.24 23:51
Hello I did the code below, it gives the message, but is opening orders, which is wrong, see int liveAccountNumber = 134561; |
|
ukt
2008.06.25 01:56
paulo, ok then - why not use "if (AccountNumber() != liveAccountNumber) return(-1);" in at beginning of start() instead of: int start() ... reason? because start() still gets called each data tick. so what you had in init() may issue the Alert("..."); but you also need the if(...)return(-1); at top of start() too. Please notice your code: if (!AccountNumber()) why? AccountNumber() is a typed function returning an int value - is not used like a bool so you must have something like this: int start() ... //do trading here if AccountNumber() is same as liveAccountNumber ... return(0); }//end of start() can keep init() like it is but above should stop further execution of EA if running on account number different than liveAccountNumber. hth |
|
paulofoxstar
2008.06.25 16:47
I am a newcomer in EA's, that would be asking too much if you could correct the code for me? I tried what you said and I could not |
|
ukt
2008.06.25 16:57
paulofoxstar wrote >>
I am a newcomer in EA's, that would be asking too much if you could correct the code for me? I tried what you said and I could not If formatted, for example: void start() { int i, b=0, bb=0, eb; string comm, st; string fn=Symbol()+Period()+" "+ TimeToStr(BeginDate, TIME_DATE)+"-"+ TimeToStr(EndDate, TIME_DATE)+".csv"; for (i=Bars; i>0; i--) { if (Time[i]>=BeginDate && Time[i]<=EndDate) { if (bb==0) bb=i; // фиксируем номер первого бара st=TimeToStr(Time[i], TIME_DATE)+Separator+ TimeToStr(Time[i], TIME_MINUTES)+Separator+ DoubleToStr(Open[i], Digits)+Separator+ DoubleToStr(High[i], Digits)+Separator+ DoubleToStr(Low[i], Digits)+Separator+ DoubleToStr(Close[i], Digits)+Separator+ DoubleToStr(Volume[i], 0); WritingLineInFile(fn, st); b++; eb=i; // фиксируем номер последнего бара } } comm="Начало: "+TimeToStr(Time[bb], TIME_DATE|TIME_MINUTES)+"\n"; comm=comm+"Конец: "+TimeToStr(Time[eb], TIME_DATE|TIME_MINUTES)+"\n"; comm=comm+"Выгружено баров: "+DoubleToStr(b, 0); Comment(comm); } Why? unable cope with left justified programming code... need structure else unable/willing to keep file open longer than takes to close it... ;) If you have source file layed out (formatted) block structure etc, then why not post? Many able people live on forum, yes? I will look but cannot make promises - nor can [I believe] others make promises. Unless of course you contact money wanting person. For that, is link/article on forum to guide you in selection of [hopefully] decent programmer. regards |
|
paulofoxstar
2008.06.25 17:01
Do not you understand what you mean .. |
|
ukt
2008.06.25 17:34
UNformatted: int init() { if (!IsDemo()) { Alert("Invalid Account. Please contact EA Provider"); return(-1); } else { return(1); } } //+------------------------------------------------------------------+ int start() { if (!IsDemo()) return(-1); formatted: int init() { if (!IsDemo()) { Alert("Invalid Account. Please contact EA Provider"); return(-1); } else { return(1); } } //+------------------------------------------------------------------+ int start() { if (!IsDemo()) return(-1); |
|
paulofoxstar
2008.06.25 17:47
I think I could modify the code, see
int liveAccountNumber = 5513037; int init() if( AccountNumber() != liveAccountNumber ) { //+------------------------------------------------------------------+ int start() |