[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 669

 
Diger:

Has this happened to anyone?

No LOSS in the strategy tester log and the graph curve is going steadily downwards.

What would that mean?

The force of gravity... :)) You're not on Jupiter? :)) Sorry - just kidding...
 
Diger: Has this happened to anyone? No LOSS in the strategy tester log and the graph curve is going steadily downwards. What would that mean?
Spread is down. Too many trades. Open the tester's chart.
 
artmedia70:
The power of gravity... :)) You're not on Jupiter? :)) Sorry - just kidding...

I'm a bit of a freak myself. Maybe I really am. ....
 
Richie:
Drain on the spread. Too many trades. Open the tester's chart.


You were right!

Against the usual 2p we now have 26...

Thank you!

 
Diger:


You turned out to be right!

Against the usual 2p we now have 26...

Thank you!

Add a condition for the maximum spread above which trades are not opened (but those already opened continue to be controlled by the EA).

 
chief2000:

Add a condition for the maximum spread above which trades are not opened (but those already opened continue to be controlled by the EA).


I didn't think it was necessary before.

But today's tester showed me this need.

 

By the way, it is also interesting and unclear to me. I have added to my Expert Advisor a loss-making lot by a principle: find the biggest loss and open an opposite position with the lot of that loss multiplied by the coefficient calculated from the current state of the market at all TFs and the position relative to the open loss and the current price, as well as the price chart itself (like - is it really worth opening a lot, if the price moved in the right direction...). Respectively, when the total profit of these two positions is about 50-60 points - we close both of them, profitable one at first.

So, I noticed that profitable trading system, which gives stable profit for two years in the tester, but has in its arsenal of wild drawdowns, which cannot be accepted, if I use loops, it fails within two months... What could be the reason? Just a quick guess. I didn't save the drainage stats because "why?"

 

Question:

I have to refer to the same sequence of codes many times, on every tick in almost all the strategies implemented in the EA, to get data on the current state of the market.

   CurAsk   =MarketInfo(Symbol(),MODE_ASK);
   CurBid   =MarketInfo(Symbol(),MODE_BID);
   OpnPrice =iOpen(NULL,PERIOD_M5,0);
   OpnPrice1=iOpen(NULL,PERIOD_M5,1);
   ClsPrice1=iClose(NULL,PERIOD_M5,1);
Can I address them only once at the beginning of the start function, and then address only the global variables, which will store the data? It's a bit of a pain in the ass...
 
artmedia70:

Question:

I have to refer to the same sequence of codes many times, on every tick in almost all strategies implemented in the EA, to get data on the current market state.

Can I address them only once at the beginning of the start function, and then address only global variables that will store this data? I'm getting a bit oily here...


OpnPrice =iOpen(NULL,PERIOD_M5,0);

I understand that the calculation is done on the zero bar, i.e. every tick will change the data

If you like - you should write a script and loop it and it will feed you this calculation into global variables, but in this case you need to synchronise new data with every tick. I think it's better to leave it as it is, but deliver it into a separate function and call this function only in necessary cases, i.e. if the calculation is important for opening orders, then just before opening and respectively closing them

 
IgorM:


OpnPrice =iOpen(NULL,PERIOD_M5,0);

Here I understand that the calculation is done on a zero bar, i.e. every tick will change the data

logically - you should write a script and loop it and it will feed you with this calculation into global variables, but in this case you'll need to synchronize new data with every tick. I think it's better to leave it as it is, but deliver it into a separate function and call this function only when needed, i.e. if the calculation is important for opening orders, then just before opening and respectively closing them

Igor, I am doing so so far, but I'm afraid it slows down the already slow system consisting of all these strategies mixed together and connecting by conditions, and sometimes they all work simultaneously. Imagine that each of them calls the same code in a separate function.

It seems to me - so what if some data is taken from the zero bar, as I already open at zero bar... I only get data from the first, second or third bar...
OpnPrice =iOpen(NULL,PERIOD_M5,0); I get the open price of the current bar and it won't change - this is a fait accompli . When comparing the previous close price and the open price of the current bar, some functions give either leave or refuse to open a position...

So let this data all be read once with the arrival of the tick, and then be used by the Expert Advisor. They will be unchanged and actual until the next tick, when the Expert Advisor will update them for the next calculation cycle.

What is the probability of a new tick coming before the end of all current calculations? It seems to me that only in this case the data will become old and irrelevant.