Topics
05 Dec 2012, 10:51
 5015
 6
30 Nov 2012, 16:19
 3035
 2
22 Oct 2012, 15:56
 3088
 5
Replies

adaled
18 Jul 2013, 17:10

you can reference MacdCrossOver Indicator and index the MACD from it.

    [Indicator(IsOverlay = false, TimeZone = TimeZones.UTC, ScalePrecision = 5)]
    public class Macd_function : Indicator
    {
        private MacdCrossOver macd;
        
        [Parameter(DefaultValue = 0.001)]
        public double Value { get; set; }

        [Output("Main")]
        public IndicatorDataSeries Result { get; set; }
        

        protected override void Initialize()
        {
            // Initialize and create nested indicators
            macd = Indicators.MacdCrossOver(26,12,9);
        }

        public override void Calculate(int index)
        {
            // Calculate value at specified index
            
            Result[index] = macd.MACD[index]; // so you see the macd values on the chart
            
            if(!IsRealTime) return; // so that you don't print all historical values
            
            if(macd.MACD[index] >= Value)
                Print("Macd crossed over Value at {0}", macd.MACD[index]);  // your logic
        }
    }




@adaled

adaled
18 Jul 2013, 12:35

I think you need to give a better explanation. :)


@adaled

adaled
18 Jul 2013, 12:27

I think it's similar to round numbers. /algos/indicators/show/263


@adaled

adaled
18 Jul 2013, 11:50

Yes, access to historical trades would be really nice to have.  


@adaled

adaled
16 Jul 2013, 17:48

That is the tick volume, it is the number of ticks.


@adaled

adaled
16 Jul 2013, 17:39

you can try this 2calgo.com

/forum/indicator-support/1223


@adaled

adaled
16 Jul 2013, 14:59

Why is the events tab preferable to the history? Just curious.


@adaled

adaled
19 Jun 2013, 16:03

RE:
MrTrader said:

Hi also, could you remove Trailing stop losses, its not needed.

What entry are you using for this robot E.G wait for 5 pips above Gann Indicator to trigger buy/sell?

 

Thanks,

Hi, the trailing stop is actually optional. it only trails if the parameters are greater than 0. I put this in the description.

The triggers are as you said:

The method be Buy if the price has risen above the indicator and Sell if price has fallen below the indicator.


@adaled

adaled
18 Jun 2013, 16:42

Hello again, it has very poor results... Maybe you would like to share some more trading logic besides what you mentioned?


@adaled

adaled
13 Jun 2013, 18:26

RE: RE:
MrTrader said:
adaled said:

Look at SampleTrendRobot. It's doing something very similar with moving average indicator.

You can use the functions HasCrossedAbove/HasCrossedBelow to find your triggers:

Something like this in the OnTick or the OnBar:

if(Functions.HasCrossedBelow(Gann.Result, MarketSeries.Close[index], 0)
{
        Buy();
}
else if(Functions.HasCrossedAbove(Gann.Result, MarketSeries.Close[index], 0)
{
        Sell();
}
   

Buy() and Sell() can be copied from the SampleTrendRobot (in cAlgo list of robots)

 

 

Hello, Ive also found a robot with a similiar method SMA 252 /algos/robots/show/175

Can you help me out with this?

 

Thanks,

OK...

I'll let you know when it's ready.


@adaled

adaled
13 Jun 2013, 11:29

RE:
stevenwgm83 said:

Hi all,

I understand cTrader already has Welles Wilder Smoothing built in as Smoothed MA.

I am after one that can be shifted... Can anyone please help?

 

Taka a look at this it might help:

/forum/calgo-reference-samples/733

You are basically going to just replace the moving average indicator name...


@adaled

adaled
13 Jun 2013, 11:27

Look at SampleTrendRobot. It's doing something very similar with moving average indicator.

You can use the functions HasCrossedAbove/HasCrossedBelow to find your triggers:

Something like this in the OnTick or the OnBar:

if(Functions.HasCrossedBelow(Gann.Result, MarketSeries.Close[index], 0)
{
        Buy();
}
else if(Functions.HasCrossedAbove(Gann.Result, MarketSeries.Close[index], 0)
{
        Sell();
}
   

Buy() and Sell() can be copied from the SampleTrendRobot (in cAlgo list of robots)

 

 


@adaled

adaled
13 Jun 2013, 11:02

Yes, it's included in the folder where the cAlgo.exe is.

 


@adaled

adaled
07 Jun 2013, 13:05

Hi,

Do you mean when lower timeframe trend matches current timeframe trend of supertrend indi?  I think it's not possible.


@adaled

adaled
07 Jun 2013, 10:00

Which program???

The first part was provided already. 
The second cannot be done...


@adaled

adaled
24 May 2013, 09:19

Thanks for pointing that out. I was wondering why there were no crossings :) Thanks.


@adaled

adaled
17 Sep 2012, 12:16

Hi rupweb,

I'm also new to this but I found that both OnTick and OnBar work on backtesting. That is if you use the OnTick it will work tick by tick like you said, and OnBar will work bar by bar.

 


@adaled