Hello,
I have the following problem.
I need to calculate the following for a number of FX quotation series:
(Current Close - Lowest Low) / (Highest High - Lowest Low) * 100
This is done in a moving average window of 14 weeks. Then, this is smoothed by 4 week moving average.
How do I program this? In an easy way, using FOR NEXT function for example...
Thanks!
PD. I am attaching FX series. Thanks
Moving Window
Moderators: EViews Gareth, EViews Moderator, EViews Jason, EViews Matt
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Moving Window
- Attachments
-
- fx_series.xlsx
- (1013.63 KiB) Downloaded 481 times
-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Moving Window
So I got the following and it worked
With a little variations, without the final smoothing.
Code: Select all
for %y arg au bz ca ch cl co cz gb hr hu id in is jn mal mx no nz pd pe ph ru sa sk sw ta te th tu us
genr it_{%y}=100*(fx_{%y}-@movmin(fx_{%y},14*5))/(@movmax(fx_{%y},14*5)-@movmin(fx_{%y},14*5))
next-
rmoralesaramburu
- Posts: 52
- Joined: Mon Nov 18, 2013 9:09 am
Re: Moving Window
What I would like to do next (and this time I have no idea how...please help!!) is a backtesting with that indicator.
I would like it to calculate profits when the indicator (it_{%y}) is above 80, and below 20 !!, for example
it_pe, and fx_pe. Sell fx_pe when indicator >80 and buy fx_pe when the indicator is <20...
If you have several sells before the buy, just catch the first one.
If you have several buys before the sell, just catch the first one.
Thanks!!
I would like it to calculate profits when the indicator (it_{%y}) is above 80, and below 20 !!, for example
it_pe, and fx_pe. Sell fx_pe when indicator >80 and buy fx_pe when the indicator is <20...
If you have several sells before the buy, just catch the first one.
If you have several buys before the sell, just catch the first one.
Thanks!!
-
EViews Gareth
- Fe ddaethom, fe welon, fe amcangyfrifon
- Posts: 13604
- Joined: Tue Sep 16, 2008 5:38 pm
Re: Moving Window
I can't follow what you're asking there, sorry.
Who is online
Users browsing this forum: No registered users and 2 guests
