[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 35

 
emorzh:

Dear forum members, help!

I need an indicator with the following requirements: 1) Intersection of two MAs (you can choose type of MA, period of MA, what MA is applied to, as well as shift).

2) The indicator draws an arrow at the intersection point.

3) At the moment of crossing, there will be a beep and an e-mail message.

4) The signal is produced only once. At the moment of crossing the MA.

There are two indicators: MA_Shift_Crossover_Alert.mq4 and 2MA CrossoverWithPrice_fixed.ex4

The first one doesn't like that the signal is given at every candlestick and after crossing the MA. The second one does not manage to set the MA shift.

Is there some way to add the possibility to shift MA to the second indicator?

The indicators are attached in the archive.

Thank you.

This is done in your case without (additional) indicator.

In your Expert Advisor you define the point of intersection of two MAs and put an arrow on the chart and simultaneously activate the audible signal and send an email to yourself.

 
demlin:

Here's the code, copied from the tutorial from the same site :)

I want to eventually get two lines and read their value on any bars via iCustom

Well... You need to add two indicator buffers to the indicator code: one for trend Buy lines and one for trend Sell lines of the fork.

In these lines building functions call the equation function in the loop from tim2, VMF2 to tim1, VMF1 and at each cycle iteration write data, returned by the equation function, into the corresponding indicator buffer. Further, in the Expert Advisor, you can already read the data of these buffers by iCustom();

And do not forget to zero arrays in the functions of deleting trend lines of the indicator

 
artmedia70:

Well... Here you need to add two indicator buffers to the indicator code: one for trend Buy and one for trend Sell fork lines.

In these lines building functions call the equation function in the loop from tim2, VMF2 to tim1, VMF1 and at each cycle iteration write data, returned by the equation function, into the corresponding indicator buffer. Further, in the Expert Advisor, you can already read the data of these buffers by iCustom();

And do not forget to zero arrays in the functions of deleting trend lines of the indicator

Thank you I will try to do so
 
MaxZ:

Yes. But the best way to solve this problem is to use a loop with a post precondition "while" rather than a loop with a counter "for". Because you do not know how many bullish or bearish candlesticks you will encounter in a row.

Start with a simpler problem, if you find it so difficult. For example, display the numbers from a to b in increments of s. Or find the factorial of n with a loop.

And to practice, solve these problems using both types of loops ("for" and "while"). Then you can start to improve your indicator.


MaxZ, thanks for your help. Haven't been online for a couple of days, just got here now. I'll be back when I get the results.
 

Goodnight!!! Tut I have, ie us, clogged disks C and D, my brother said, molder platforms to blame, they test and clog.( Actually, I have up to 40 folders, on my disk C but they are from one-2-19Mega-bytes and just pale in comparison with tanks, shooter-walker, etc., to 43 256.0 MB (!!!!!!!!!!!!!). (Some toy, a monster or something).

Where and what is stored platforms during testing?

How to delete it?

How to hide a folder?

How to open it?

Please advise!

 
Dimka-novitsek:

Goodnight!!! Tut I have, ie us, clogged disks C and D, my brother said, molder platforms to blame, they test and clog.( Actually, I have up to 40 folders, on my disk C but they are from one-2-19Mega-bytes and just pale in comparison with tanks, shooter-walker, etc., to 43 256.0 MB (!!!!!!!!!!!!!). (Some toy, a monster or something).

Where and what is stored platforms during testing?

How to delete it?

How to hide a folder?

How to open it?

Please advise!

Kill all the files:

1. in the Logs folders (there are two)

2. delete everything in the History folders (there are two too)

And start your life from scratch.

 

(while we are writing another expert system, as was correctly noted without burying the previous ones))))

I came up with a scheme that works on minute periods

I have not been able to test it on earlier periods - I just do not know how.

The question is - if the deposit is big enough, what is the risk of this pattern? How dangerous is the drawdown in this case?


 
Dimka-novitsek:

Goodnight!!! Tut I have, ie us, clogged disks C and D, my brother said, they blame the platform, they test and clog.( Actually, I have up to 40 folders, on my disk C but they are from one - 2-19Mega-bytes and just pale in comparison with the tanks, shooter, wanderers, etc., to 43 256.0 MB (!!!!!!!!!!!!!). (Some toy, a monster or something).

Where and what is stored platforms during testing?

How to delete it?

How to hide a folder?

How to open it?

Pozalusta, tell me!

Good. For such cases there is a file - cleaner of all unnecessary things in MT4 folder of the client terminal - clear.bat (in the trailer), put it in the main directory of your terminal (terminals) and run it for execution - at once everything will be fine, all unnecessary (including logs, etc. - will be removed) - I use it from time to time.

P.S. After its use and during subsequent tests of the trading systems, do not forget to download the history for the instruments of interest in the strategy tester via F2. All of the Expert Advisors, all of their settings, their input parameters - it all remains, do not worry.

Files:
clear.zip  1 kb
 

Max, if you still do not consider 90.36% drawdown dangerous, then trade on it.

P.S. Frankly speaking, I cannot understand how come equity is higher than the growing balance almost all the time, while the drawdown is so big. I have my doubts about the drawdown calculation algorithm...

 
Maxaxa:

(while we are writing another expert system, as was correctly noted without burying the previous ones))))

I came up with a scheme that works on minute periods

I have not been able to test it on earlier periods - I just do not know how.

The question is - if the deposit is big enough, what is the risk of this pattern? How dangerous is the drawdown in this case?



First of all, few trades - make sure there are at least 200. Organize control over the opening of a new bar, test it using the model: "At open prices ..." (do not allow making deals inside of a minute bar - everything is strictly at open prices, for Expert Advisors with explicit control of a new bar formation). Besides, when placing orders and modifying them, do not forget to make necessary checks, making necessary processing of possible errors on this (and not only) issue. That is all, IMHO.
Reason: