@waves, I see that this is your first post, but I still feel obliged to remind you that when you post some code, you should always use the mandatory tags as explained here.
Moreover, in general, you should make an effort to better explain your issue (code alone, sometimes, in not enough).
I did not test your code, but in any case, I wonder if the ChartID parameter in your Study() calls is the correct one, as explained in the documentation.
CHARTID - identifies the chart pane where the study was drawn - you can find out what is the chart ID for given chart by looking in Parameters dialog, Axes & Grid, Miscellaneous: Chart ID or using GetChartID() AFL function.
Please, follow the above recommendations and provide additional feedback.