using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MarketData.MarketDataModel
{
  // MACD(12,26,9) is common
  // MACD(12,25,9) is another
  // MACD(5,35,5) is another alternative
  // MACD(8,17,9) is faster, more sensitive
  public class MACDSetup
  {
    public int fast;
    public int slow;
    public int signal;

    public MACDSetup(String macdSetup)  // (12,26,9) , MACD(8,17,9) macd(12,26,9)
    {
      macdSetup = macdSetup.ToUpper();
      macdSetup = macdSetup.Replace("MACD", "");
      macdSetup = macdSetup.Replace("(", "");
      macdSetup = macdSetup.Replace(")", "");
      String[] macd = macdSetup.Split(',');
      fast = int.Parse(macd[0]);
      Slow = int.Parse(macd[1]);
      signal = int.Parse(macd[2]);
    }
    public MACDSetup()
    {
      fast = 12;
      slow = 26;
      signal = 9;
    }
    public MACDSetup(int fast, int slow, int signal)
    {
      this.fast = fast;
      this.slow = slow;
      this.signal = signal;
    }
    public int Fast
    {
      get { return fast; }
      set { fast = value; }
    }
    public int Slow
    {
      get { return slow; }
      set { slow = value; }
    }
    public int Signal
    {
      get { return signal; }
      set { signal = value; }
    }
    public override string ToString()
    {
      return "MACD(" + fast + "," + slow + "," + signal + ")";
    }
  }
}
