Information

Username: ghazisameer
Member since: 30 Aug 2018
Last login: 30 Aug 2018
Status: Active

Activity

Where Created Comments
Algorithms 0 4
Forum Topics 6 2
Jobs 0 0

Last Algorithm Comments

GH
ghazisameer · 5 years ago

I just bought three algos from you today after testing them out last week. The algos are (1) Supply and Demand Zones (2) Market Status and (3) Reversal Magic. However (2) is not loading and is  showing "TRIAL EXPIRED". I tried deleting and reinstalling it but the same problem persists. Please help me asap as I paid $30 for it and is an important tool in my trading strategy.

Keenly awaiting for your reply.

Regards

Sameer

GH
ghazisameer · 5 years ago

I just bought three algos from you today after testing them out last week. The algos are (1) Supply and Demand Zones (2) Market Status and (3) Reversal Magic. However (2) is not loading and is  showing "TRIAL EXPIRED". I tried deleting and reinstalling it but the same problem persists. Please help me asap as I paid $30 for it and is an important tool in my trading strategy.

Keenly awaiting for your reply.

Regards

Sameer

GH
ghazisameer · 6 years ago

I also prefer it to lines rather than dots. Please help in this regard

 

GH
ghazisameer · 6 years ago

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

42

43

44

45

46

47

48

49

50

51

52

53

54

55

56

57

58

59

60

61

62

63

64

65

66

67

68

69

70

71

72

73

74

75

76

77

78

79

80

81

82

83

84

85

86

87

88

89

90

91

92

93

94

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

111

112

using System;

using cAlgo.API;

using cAlgo.API.Indicators;

 

namespace cAlgo.Indicators

{

    [Indicator(IsOverlay = true, AccessRights = AccessRights.None)]

    public class Supertrend : Indicator

    {

        [Parameter(DefaultValue = 10)]

        public int Period { get; set; }

 

        [Parameter(DefaultValue = 3.0)]

        public double Multiplier { get; set; }

 

        [Output("UpTrend", Color = Colors.Green, PlotType = PlotType.Liness, Thickness = 3)]

        public IndicatorDataSeries UpTrend { get; set; }

 

        [Output("DownTrend", Color = Colors.Red, PlotType = PlotType.Lines, Thickness = 3)]

        public IndicatorDataSeries DownTrend { get; set; }

 

        private IndicatorDataSeries _upBuffer;

        private IndicatorDataSeries _downBuffer;

        private AverageTrueRange _averageTrueRange;

        private int[] _trend;

        private bool _changeofTrend;

 

        protected override void Initialize()

        {

            _trend = new int[1];

            _upBuffer = CreateDataSeries();

            _downBuffer = CreateDataSeries();

            _averageTrueRange = Indicators.AverageTrueRange(Period, MovingAverageType.WilderSmoothing);

        }

 

        public override void Calculate(int index)

        {

            // Init

            UpTrend[index] = double.NaN;

            DownTrend[index] = double.NaN;

 

            double median = (MarketSeries.High[index] + MarketSeries.Low[index]) / 2;

            double atr = _averageTrueRange.Result[index];

 

            _upBuffer[index] = median + Multiplier * atr;

            _downBuffer[index] = median - Multiplier * atr;

 

 

            if (index < 1)

            {

                _trend[index] = 1;

                return;

            }

 

            Array.Resize(ref _trend, _trend.Length + 1);

 

            // Main Logic

            if (MarketSeries.Close[index] > _upBuffer[index - 1])

            {

                _trend[index] = 1;

                if (_trend[index - 1] == -1)

                    _changeofTrend = true;

            }

            else if (MarketSeries.Close[index] < _downBuffer[index - 1])

            {

                _trend[index] = -1;

                if (_trend[index - 1] == -1)

                    _changeofTrend = true;

            }

            else if (_trend[index - 1] == 1)

            {

                _trend[index] = 1;

                _changeofTrend = false;

            }

            else if (_trend[index - 1] == -1)

            {

                _trend[index] = -1;

                _changeofTrend = false;

            }

 

            if (_trend[index] < 0 && _trend[index - 1] > 0)

                _upBuffer[index] = median + (Multiplier * atr);

            else if (_trend[index] < 0 && _upBuffer[index] > _upBuffer[index - 1])

                _upBuffer[index] = _upBuffer[index - 1];

 

            if (_trend[index] > 0 && _trend[index - 1] < 0)

                _downBuffer[index] = median - (Multiplier * atr);

            else if (_trend[index] > 0 && _downBuffer[index] < _downBuffer[index - 1])

                _downBuffer[index] = _downBuffer[index - 1];

 

            // Draw Indicator

            if (_trend[index] == 1)

            {

                UpTrend[index] = _downBuffer[index];

                if (_changeofTrend)

                {

                    UpTrend[index - 1] = DownTrend[index - 1];

                    _changeofTrend = false;

                }

            }

            else if (_trend[index] == -1)

            {

                DownTrend[index] = _upBuffer[index];

                if (_changeofTrend)

                {

                    DownTrend[index - 1] = UpTrend[index - 1];

                    _changeofTrend = false;

                }

            }

        }