[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 178

 
unnnamed:

Thanks Eddie, but that's not it.

Why not? Create these objects on one graph and place them on all of them.

unnnamed:
I need an indicator to show the entered information on all charts. For example, I select "AUDUSD - up, GBPUSD - down" in the chart window and NZDUSD (the indicator is displayed on it) will be automatically updated in the form of icons and text in the real time mode. Is it possible to do such a thing and in which direction to start looking?

you can do it here, and i can do it myself.

 
Roman.:


Solution:

For buy (sell - by analogy):

1. MA fracture - get MA values on bars 3, 2 and 1 - compare. If MA values on bars 3>2 and 2<1, it is a break.

2. then - fractal - penetration - a signal to make a deal

As far as the enumeration of MA is concerned - place it in external (optimizable) variables:

Period_MA (you can set from 2 to 240 with step 2), MODE - (method of calculation of MA - range of changes from 0 to 3 step 1), PRICE_TYPE - (price constant - range of changes from 0 to 6 step 1), I heard that when working within the day MA count on the average values (closing price is not important), when working on the day candles MA count on the closing prices of the days.

PERIOD - you change it manually with each subsequent optimization - 1,5,15,30,60,240...

Press F1 on the iMA - carefully read everything there again.

And of course optimize TP and Stop Loss as usual.

P.S. Don't forget to write an information on the test results... :-)))

I have tested all TFs from M1 to H1 with optimization of all MA up to period = 120. The result is that this strategy is not profitable. The best variant was at H1 with optimization for 16 days and testing for the next 3 days. But in the end this variant also gives a loss.
 
unnnamed:

Thanks Eddie, but that's not it. Reread my post and realised it was misleading. I've attached a picture, there's a more detailed description.

I think it's doable with mt5 classes... there are more functions
 
eddy:

Be more specific.

an array are variables with the same name but a different number

For example there is a flag, it can be written manually if (!A ) then ClsB[3] =true.

I can't figure out how to make i take value 3 automatically, that's why I'm asking for an example. In the tutorial, as it is there with a predefined array Open[i] - is not quite clear, at least for me! I think that all programming geniuses started somewhere and were not born with a calculator in their umbilical cord...

if (Cls_B[i]||Cls_S[i]) LotCt=NormalizeLot(OrderLots()/(4-i)); 
 

What do you mean by "automatic"? Programming is automation. if i is not set by an external parameter, it is set automatically.

What value of i do you want?

 
volshebnik:
Tested all TFs from M1 to H1 with optimization of all MAs up to period = 120. The result - this strategy is unprofitable. The best variant was at H1 with optimization for 16 days and testing for the next 3 days. But in the end this variant gives loss as well.


Who would doubt it... Everything should have been clear as day, in my opinion. :-)))

I have helped you in your research to come to THIS solution.

 
eddy:

What do you mean by "automatic"? Programming is automation. if i is not set by an external parameter, it is set automatically.

What value of i do you want?

To solve this problem nicely:
if (Cls_1) LotCt=NormalizeLot(OrderLots()/4); 
             else if (Cls_2) LotCt=NormalizeLot(OrderLots()/3);
                  else if (Cls_3) LotCt=NormalizeLot(OrderLots()/2);  
In the form of. It may be simple... But I keep getting an error
if (Cls_[i]) LotCt=NormalizeLot(OrderLots()/(4-i)); 
 
100yan:
To solve this problem beautifully:
In the form of. It may be simple... But I keep getting an error.
Formulate the condition in words, helps.
 
100yan:
To solve this problem nicely:
In the form of. It might be simple... But I keep getting an error.

1) how you have set up the Cls_ array

2) Why do you need it in this problem in principle? Just save 1/2/3 in Cls_ and write:

 LotCt=NormalizeLot(OrderLots()/(4-Cls_)); 
 
Good day! If inside an indicator located on a certain pair, say Eurodollar, I write Buffer1[0]=Close[i], I get the price of this pair. But if I want to share with Close[i] another pair, say, GBPdollar?
Reason: