# 4 functions for the "ttrTests" package to work with the "Datasnoop" function

Bajet $10-30 USD

***R Programming***

I need 4 simple strategi functions, which can be implemented in the "ttrTest package" in the R programming language.

The functions must be capable of being implemented in the “datasnoop” function in the “ttrTests” package. See example1 below.

Im trying to replicate the work of Halbert White(2000) by making the same strategies as him to calculate whites p-value.

The strategies that White implement are the following:

- Filter rule

- Moving average rule

- Support and resistance rule

- Channel break out

It is very simple strategies. I provide 3 examples of functions that works with the ttrTest package. This is provided as “example2, example3 and example 4”.

I need the 4 strategies to be implemented with the dataSnoop function, the same way as shown in example1.

I figure it should be relative easy, if you know how to code.

1.1 Filter Rules

"A filter rule strategy is specified as follows. If the daily closing price (in U.S. dollars) of a foreign currency goes up by x% or more from its most recent low, then the speculator borrows the dollar and uses the proceeds to buy the foreign currency. When the closing price of the foreign currency drops by at least y% from a subsequent high, the speculator short sells the foreign currency and uses the proceeds to buy the dollar. We define the subsequent high as the highest price over the e most recent days and the subsequent low as the lowest price over the e most recent days. We also consider the case where a given long or short position is held for c days during which time all other signals are ignored."

1.2 Moving Average Rules

"The moving average of a currency price for a given day is computed as the simple average of prices over the previous n days, including the current day. Under a moving average rule, when the short moving average of a foreign currency price is above the long moving average by an amount larger than the band with b%, the speculator buy. Similarly, when the short moving average is below the long moving average by b%, the speculator short sells. In addition to this fixed percentage band filter, we also implement the moving average rules with a time delay filter, which requires that the long or short signals remain valid for d days before he takes any action. As in the filter rule case, we also consider the case where a given long or short position is held for c days during which time all other signals are ignored."

1.3 Trading Range Break (or Support and Resistance) Rules

"Under a trading range break rule, when the price of a foreign currency exceeds the maximum price (resistance level) over the previous n days by b%, the speculator borrows the dollar to buy the foreign currency. When the price goes below the minimum price over the previous n days by b%, the speculator sells short the FX to buy the dollar. We also consider an alternative definition for the resistance level, i.e., the local maximum (minimum), which is the most recent closing price higher (lower) than the e previous closing prices. As with the moving average rules, we implement the rules with a time delay filter, d, and as well we consider the case where a given long or short position is held for c days during which time all other signals are ignored."

1.4 Channel Breakout Rules

A channel is defined to be one that occurs when the high price of a foreign currency over the previous n days is within x% of the low over the previous n days. Under a channel breakout rule, the speculator borrows the dollar to buy FX when the closing price of the foreign currency goes above the channel by b% and sells short the FX to buy the dollar when the closing price goes below the channel by b%. Once again, we consider holding a given long or short position for c days during which all other signals are ignored.

Please look at the examples provided and ask for more details.

## 2 pekerja bebas membida secara purata $80 untuk pekerjaan ini

1.I am an expert in R programming, Statistics, regression analysis, using both Excel and SPSS, also expert in Excel, Excel formulas, and all excel functions, macros, lookup, pivot tables and charts. [login to view URL] done many p Lagi

I have 15 yrs experience in Microsoft applications: Pdf to word, Pdf to Excel, Excel, Word, Powerpoint and creatings, Entry, Copy-pasting, Typing and having 60 WPM Typing speed wants to reduce your work load and wants Lagi