help code please

 
Good afternoon.
I hope this time you can help me :-)

Here is a piece of code, this code only works on the pair lying on the graph.

but I need it to work on any pair.
example is my indicator on GBPUSD fonctionneras this code very well now I'm on GBPUSD and EURUSD parameter I put the it does not work because I do not know how to HIGH, LOW etc. ..

could you give me example code its seven lines to work whatever the chosen pair.

 

 

if(ValSum[i]>(High[i]+Low[i])/2 && ValSum[i+1]<(High[i+1]+Low[i+1])/2) 
else if(ValSum[i]<(High[i]+Low[i])/2 && ValSum[i+1]>(High[i+1]+Low[i+1])/2) 

 MainVal[i]=Low[i];

 if(ValSum[0]<(High[0]+Low[0])/2)
 else if(ValSum[0]>(High[0]+Low[0])/2)


 if ( High[1]>(iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_MAIN,1) + ((iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_UPPER,1) - 
       iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_MAIN,1)) * BB2multiplier)))

 if ( Low[1]<(iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_MAIN,1) - ((iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_MAIN,1) - 
       iBands(Symbol(),0,cnt,2,0,PRICE_CLOSE,MODE_LOWER,1)) * BB2multiplier)))

thank you for your help.
 
phenix77:
Good afternoon.
I hope this time you can help me :-)

Here is a piece of code, this code only works on the pair lying on the graph.

but I need it to work on any pair.
example is my indicator on GBPUSD fonctionneras this code very well now I'm on GBPUSD and EURUSD parameter I put the it does not work because I do not know how to HIGH, LOW etc. ..

Instead of using High[] and Low[],  use iHigh() and iLow() . . .  then you can set the symbol that you want the high and low for . . .


To be able to use any symbol and not just the symbol of the chart use a variable that holds the chosen Symbol name . . . 

extern string ChosenSymbol = "EURJPY";    //  set the correct symbol name for this variable

  . . . you use this variable in your iHigh, iLow and iBands unction calls,  for example . . .

if ( iHigh(ChosenSymbol, 0, 1) > (iBands(ChosenSymbol, 0, cnt, 2, 0, PRICE_CLOSE, MODE_MAIN, 1) + ((iBands(ChosenSymbol, 0, cnt, 2, 0, PRICE_CLOSE,MODE_UPPER,1) - 
       iBands(ChosenSymbol, 0, cnt, 2, 0, PRICE_CLOSE, MODE_MAIN, 1)) * BB2multiplier)))
 
thank you very much

I thought it was more complex than that.

I realize that I do not know much when I read this forum it is frustrating :-)
friendly
 
little question

Is that the close (15) is equal to 1min UT close (1) UT 15 mins?
 
phenix77:
thank you very much

I thought it was more complex than that.

I realize that I do not know much when I read this forum it is frustrating :-)
friendly
It takes time . . .  when you have some spare time read through the top level of sections in the Documentation, for example TimeSeries Acccess,  Object Functions, etc.    make yourself aware of what kind of functions are available to you.  You don't need to know everything but it helps if you have an idea of what exists and where to find the information you need.
 
yes I know but it is very hard because I do not speak English :-)
 
phenix77:
yes I know but it is very hard because I do not speak English :-)

I can imagine that would make it harder . . .  but Forex is impossible anyway,  so you are just making the Impossible a little harder ;-)

You might see if you can find a Forum in your own language that covers Forex and has a coding section,  that way you will be able to get help in your own language  . . of course you are always welcome here too.  :-)

 
I prefer not to come here you are more competent is incredible.
the only ones that are as good as you are the Russians are impressive programming.
Forums in France are very low level.

could you answer to my little question above thank you :-)
 
phenix77:
could you answer to my little question above thank you :-)
Sure . . .  can you re-phrase it though,  I don't understand the question, sorry.
 
ah google translate not easy :-)

  close (15)  in 1 minute = close  (1) in 15 minutes?
 
phenix77:
ah google translate not easy :-)

  close (15)  in 1 minute = close  (1) in 15 minutes?

Ah I see . . .  no,  it may be but it also may not be.

Close[15]  on M1 is the close value of the bar that happened 15 bars to the left from the current bar,  so if the current time is now 14:33 and we have a M1 bar for every minute,  then Close[15] is for the bar that opened at 14:18 and closed just before 14:19

Close[1] on M15 is for the bar that happened one bar to the left, if the current time is 14:33 one bar to the left is the bar that opened at 14:15  and closed just before 14:30 . . . . 

Reason: