Code covered by the BSD License  

Highlights from
Strategy Design Pattern in Matlab 2008b

from Strategy Design Pattern in Matlab 2008b by Paul Williamson
Strategy Pattern defined by "Gang of Four" in: "Design Patterns: Elements of ...," Gamma, et al.

Donchian
classdef Donchian < StrategyType
%DONCHIAN Summary of this class goes here
%   Detailed explanation goes here
% This class has a contract with the StrategyType Interface. It must
% deliver a RunStrategy method that takes in a TimeSeries class

   properties
   end

   methods
       function RunStrategy(obj, ts)
          fprintf('Donchian:RunStrategy %s\n', ts.Name); 
          % This would contain all the calcs for this strategy
          % The data to work on has been passed in via the ts class
       end
   end
end 

%EOF

Contact us at files@mathworks.com