i am coding my first script. it calls 3 indicators using iCustom. the issue is that the indicators are 3 versions of the same indi just with diff parameter settings, saved under different filenames (this makes it easier to do some other data exporting i am doing.)
since the 3 indis have the same code, they have identical variable names. how do i distinguish them from each other ? is there another array i should set am i even declaring them properly? i am out of my comfort zone here and want to learn.
double trendH4val
int TimeFrame.Period = 60
int TimeFrame.Auto = 0
int KPeriod = 14
int Sloww = 5
int MAMethod = 6
double PriceField = 3.0
int LLow = 5
int HHigh = 11
int arr[][4];
void start()
{
int i;
int loop=100;
myH4val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
myD1val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
myW1val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
ArrayResize(arr,loop);
for(i=loop; i>=0; i--){
arr[i][0] = myH4val; Print("bar=",i," array=",arr[i][0]," myH4val=",myH4val);
arr[i][1] = myD1val; Print("bar=",i," array=",arr[i][1]," myD1val=",myD1val;
arr[i][2] = myW1val; Print("bar=",i," array=",arr[i][2]," myW1val=",myW1val);
return(0);
}
}
obviously this needs serious help
thanks for looking
since the 3 indis have the same code, they have identical variable names. how do i distinguish them from each other ? is there another array i should set am i even declaring them properly? i am out of my comfort zone here and want to learn.
double trendH4val
int TimeFrame.Period = 60
int TimeFrame.Auto = 0
int KPeriod = 14
int Sloww = 5
int MAMethod = 6
double PriceField = 3.0
int LLow = 5
int HHigh = 11
int arr[][4];
void start()
{
int i;
int loop=100;
myH4val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
myD1val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
myW1val = iCustom(pair,tf,"MAmomentum_H4",TimeFrame.Period,TimeFrame.Auto,KPeriod,Sloww,MAMethod,PriceField,LLow,HHigh,0,shift);
ArrayResize(arr,loop);
for(i=loop; i>=0; i--){
arr[i][0] = myH4val; Print("bar=",i," array=",arr[i][0]," myH4val=",myH4val);
arr[i][1] = myD1val; Print("bar=",i," array=",arr[i][1]," myD1val=",myD1val;
arr[i][2] = myW1val; Print("bar=",i," array=",arr[i][2]," myW1val=",myW1val);
return(0);
}
}
obviously this needs serious help
thanks for looking