Hi Alexis, could you please let me know what do I need to do in order to combine two existing scripts. One for say "new" Moving Average and the other script for the condition on this moving average. For example the script for the MA would end something like this:
Average = c1 * xe6.getValue(0) + c2 * xe5.getValue(0) + c3 * xe4.getValue(0) + c4 * xe3.getValue(0);
return Average;
then the second (added) script I wrote like this):
if (close > Average){
setPriceBarColor(Color.RGB(0,255,0),Color.RGB(115, 115,117),true,false);
} if (close < Average){
setPriceBarColor(Color.RGB(0,155,0),Color.RGB(0,15 5,0),true,false);
return;
}
}
}
However, the script does not recognize the "Average" from the first script. First script works just fine, however, when I add these conditions it does not work. What am I missing?
Thank you Alexis!!!
Average = c1 * xe6.getValue(0) + c2 * xe5.getValue(0) + c3 * xe4.getValue(0) + c4 * xe3.getValue(0);
return Average;
then the second (added) script I wrote like this):
if (close > Average){
setPriceBarColor(Color.RGB(0,255,0),Color.RGB(115, 115,117),true,false);
} if (close < Average){
setPriceBarColor(Color.RGB(0,155,0),Color.RGB(0,15 5,0),true,false);
return;
}
}
}
However, the script does not recognize the "Average" from the first script. First script works just fine, however, when I add these conditions it does not work. What am I missing?
Thank you Alexis!!!
Comment