I am using weekly data from FRED, to generate crossovers from fast and slow moving averages as entry or exit signals on daily SPY data. The program works and generates weekly signals.
1. I would like to plot the daily data from SPY with another pane for the FRED data also on daily chart. How do you do it? If I specify Daily data on the data pane I get a run time error. If I specify Weekly data the program runs correctly with weekly charts.
2. If I have an entry based on the weekly FRED data and an exit based on an indicator from the daily SPY can I exit on daily bars?
Thanks,
RichMan
Size:
Color:
Size:
Color:
I thought I attached the file but here is the code. I would like to enter basedon the weekly and exit based on the daily. The exit from my code is at the end of the month not on a daily bar. You could run for any length (10 years is fine). I read over the SetScaleWeekly and Get ExternalSeries but couldn't adapt it to my need.
Thanks,
RichMan
CODE:
Please log in to see this code.
Size:
Color:
1. You shouldn't use "bar+1" as this badly peeks into the future (and causes that runtime error):
CODE:
Please log in to see this code.
2. Have you see the
Daily/Weekly chapter as I suggested? Note that when you employ this in your code, plotting a compressed series requires an extra call to
Synchronize for this
maDelta series:
CODE:
Please log in to see this code.
You'll find it in the WS Programming Guide.
Size:
Color:
With regard to the peaking, I had two thoughts, first if I use the open then I have a month to close the trade on the same bar as the entry is based on the monthly bar. Also, the indicator is based on the open while trade is based on the close? Is this not true?
However, I haven't been able to convert the data from the monthly indicator so that I can plot it on a daily chart? I have read the information and have tried several things but I always get a run time error stating "Can not convert monthly bars to daily bars". Please help.
RichMan
Size:
Color:
QUOTE:
Also, the indicator is based on the open while trade is based on the close? Is this not true?
You're accessing the value of the HullMA indicator one bar before it becomes available in real life. This is peeking.
QUOTE:
I have read the information and have tried several things but I always get a run time error stating "Can not convert monthly bars to daily bars"
I have no idea what things you tried but sounds like it wasn't done correctly.
Also the problem is that your task is not being set clear. It started as weekly/daily. Then you show some code that doesn't even have any compressed scale logic. Now you tell about some monthly bars, having a month to close the trade etc (??)
If further assistance is required please rephrase your task as clearly as possible. Start from scratch if necessary.
Size:
Color:
Size:
Color:
Glad you got it sorted out.
Size:
Color: