- Joined
- 13 June 2007
- Posts
- 838
- Reactions
- 136
morning folks, wondering if anyone can help me!
I'm wanting to look at the performance of the market for certain dates(I'm looking at past econ data release dates). I know how to code one particular date into AFL using the datenum() function and have it print an arrow on the chart for that particular day, but how would I go about that for multiple instances( well over 150 ).
Any help greatly appreciated
Hi Professor --
The date you want to flag needs to be coded in or read in -- I'll leave that for another posting if it is necessary. For now, assume that the date you want to use is: July 21, 2010
The AmiBroker equivalent is: 1100721
You can see the relationship: concatenate together: (Year-1900) in three digits, month in two digits, day in two digits.
One way is to assign the date to a variable
DateOfInterest = 1100721;
For ease of programming, store the date associated with each bar in a variable:
dn = datenum(); // do this once
The code to put a signal on that date is:
SignalDate = dn == DateOfInterest;
If you want to Buy on that date:
Buy = SignalDate;
If you want to plot showing that date:
shapes = ShapeUpArrow * SignalDate;
shapecolor = colorRed;
plotshapes(shapes,shapecolor);
Or have I misunderstood?
Thanks,
Howard