[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 94

 
ScioMe:
Thank you, can you do this: Close[3]?
Yes, you can.
 
artmedia70:

Dear forum members, I have a problem with testing an EA. To restore its work it is necessary to erase the historical data in the history folder in the terminal directory and then reload the historical data. Please advise how to enter the terminal directory, I have not found it in the manual, tried all the icons and could not find a way to enter this directory. Thank you in advance.


 
boris.45:

Boris, what's the problem?
 
artmedia70:
Create flags, e.g.

For TP1 - bool TP1, for TP2 - bool TP2, etc...

Initially their values are false.

Before the next closing, you do a check:

if (!TP1) {code for partial closing of the first part, after successful closing write TP1=true}

if (!TP2) {code for partially closing the second part, after a successful closing write TP2=true}

... and so on for all parts...

In this way, flags will signal that each part has been closed once...


Respect! I will try to implement...

 
coronel:
Thank you for your attention. Tested the EA for a fortnight, everything was going fine. Then all of a sudden the tester crashed. During the optimisation a "waiting for refresh" table appeared. I look at the log, but there are only two lines: the first one informs me about successful loading of the EA and the second one informs me about absence of historical data. Obviously, some kind of a glitch has occurred. I tried to reset the historical data using the F2 key, but the reset fails. I tried to reload the MT4 platform, but the operation of the tester was not restored. I contacted the Alpari programmers for technical support. I got the answer: Erase all the history from the history folder, which is located in the terminal directory, and after that reload the historical data. I cannot access the terminal directory, I do not know how to do this. I don't want to turn to Alpari's programmers because they work through intermediaries and this is a long process. If you know how to enter the terminal directory and erase the historical data, please help.
 
boris.45:
Thank you for your interest. I was testing the Expert Advisor for a fortnight, everything went fine. Then all of a sudden the tester crashed. During the optimisation a "wait for updates" message appeared. I look at the log, but there are only two lines: the first one informs me about successful loading of the EA and the second one informs me about absence of historical data. Obviously, some kind of a glitch has occurred. I tried to reset the historical data using the F2 key, but the reset fails. I tried to reload the MT4 platform, but the operation of the tester was not restored. I contacted the Alpari programmers for technical support. I got the answer: Erase all the history from the history folder, which is located in the terminal directory, and after that reload the historical data. I cannot access the terminal directory, I do not know how to do this. I don't want to turn to Alpari's programmers because they work through intermediaries and this is a long process. If you know how to enter the terminal directory and erase the historical data, please help.

Right-click on the terminal icon on the desktop. From the drop-down menu select "Properties". In the window that opens select "Storage location" - an explorer will open, search there for the history folder - it contains the necessary folders with historical data...


 
boris.45:
Thank you for your attention. Tested the EA for a fortnight, everything went fine. Then all of a sudden the tester crashed. I saw a "wait for updates" message during the optimization process. I look at the log, but there are only two lines: the first one informs me about successful loading of the EA and the second one informs me about absence of historical data. Obviously, some kind of a glitch has occurred. I tried to reset the historical data using the F2 key, but the reset fails. I tried to reload the MT4 platform, but the operation of the tester was not restored. I contacted the Alpari programmers for technical support. I got the answer: Erase all the history from the history folder, which is located in the terminal directory, and after that reload the historical data. I cannot access the terminal directory, I do not know how to do this. I don't want to turn to Alpari's programmers because they work through intermediaries and this is a long process. If you know how to enter the terminal directory and erase the historical data, please help.

You start MT4 somehow, so you will find the directory.

Right-click on the icon that launches MT4 and the "Properties" window will open.

There is a button "Find object". Press it and you will find yourself in the directory you need.

In the directory is a folder histiry. Go there and delete all the folders in it.

Start MT4. Press F2 and reload the quotes history.

That's it.

 

I've sketched out a new EA today, I'm writing it for myself, but if everything turns out OK I'll share it later.

I would like your opinion on what else should be added. I have already received a request from Trader. Now I can rearrange stops and Takei, move lines on the screen, show open orders and statistics on my accounts. What other requests will there be?

It turned out pretty good :)

 
coronel:

Thank you for your support!

 

Please tell me how to open a new order if a Stop Loss or TP is triggered. Preferably a code! Many thanks in advance!


for(int i=1; i<=OrdersTotal(); i++) // ???? ???????? ?????

{

if(OrderSelect(i-1,SELECT_BY_POS)==true)

{

double SL=OrderStopLoss();

double TP =OrderTakeProfit(); // TP ?????????? ???.

double Price =OrderOpenPrice();

{

if(SL >= Price)

{

OrderSend(Symbol(), OP_BUY, lots,Ask, 3, Ask - stop_loss * Point, Bid + take_profit * Point, IDENT, MAGIC, 0, Green);

}

}

Alert(i);

}

}