Topics
Replies
adaled
19 Jun 2013, 16:03
RE:
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
13 Jun 2013, 18:26
RE: RE:
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:
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
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