Description
The robot is based on different GannHighLow Indicators. If the GannHighLow Indicator crosses above or below MarketSeries and two SimpleMovingAverages are rising or falling a signal is given. Two other Indicators ChaikinMoneyFlow and MomentumOscillator or MoneyFlowIndex and MomentumOscillator support the signal.
The robot is fully automated and can run all over the week. There are no times to notice.
The robot is for one currency pair only. It is the same as the robot name.
The robot works only with a timeframe of 1h.
The robot doesn’t make many trades. There will be about 4 or 5 trades monthly.
All parameters are optimized. The parameters are marked with Buy or Sell to optimize the robots if you feel it’s necessary.
The robot has been created by me - called Mountain Trading Solutions - and you can use it for free. I also have created robots for further 8 currency pairs. If you are interested in contact me mountain.friend@outlook.de. I will send you the files of the robots and the indicators per email. New versions of the robots with an increased number of trades are planned.
// -------------------------------------------------------------------------------
//
//
//
// -------------------------------------------------------------------------------
using System;
using cAlgo.API;
using cAlgo.API.Requests;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class CADJPY2 : Robot
{
private GHLsmawws5 _GHLsmawws5Indicator;
private GHLsmawws6 _GHLsmawws6Indicator;
private GHLsmawws7 _GHLsmawws7Indicator;
private GannHighLowwws2 _gannHighLowwws2Indicator;
private GannHighLowtri _gannHighLowtriIndicator;
private GannHighLowtri1 _gannHighLowtri1Indicator;
private GannHighLowWeight _gannHighLowWeightIndicator;
private GHExp _GHExpIndicator;
private GHExp1 _GHExp1Indicator;
private GannHighLowsmatri _gannHighLowsmatriIndicator;
private GannHighLowsmatri1 _gannHighLowsmatri1Indicator;
private GannHighLowWeighted _gannHighLowWeightedIndicator;
private MovingAverage MA1;
private MovingAverage MA2;
private MovingAverage MA3;
private MovingAverage MA4;
private MovingAverage MA5;
private MovingAverage MA6;
private MovingAverage MA7;
private MovingAverage MA8;
private MovingAverage MA10;
private MovingAverage MA11;
private MovingAverage MA20;
private MovingAverage MA21;
private Position _position;
private int d;
[Parameter("Period-Buy", DefaultValue = 57)]
public int Period { get; set; }
[Parameter("Period1-Buy", DefaultValue = 51)]
public int Period1 { get; set; }
[Parameter("Period2-Buy", DefaultValue = 63)]
public int Period2 { get; set; }
[Parameter("Period3-Buy", DefaultValue = 63)]
public int Period3 { get; set; }
[Parameter("Period4-Sell", DefaultValue = 40)]
public int Period4 { get; set; }
[Parameter("Period5-Sell", DefaultValue = 35)]
public int Period5 { get; set; }
[Parameter("Period6-Buy", DefaultValue = 46)]
public int Period6 { get; set; }
[Parameter("Period7-Sell", DefaultValue = 36)]
public int Period7 { get; set; }
[Parameter("Period8-Buy", DefaultValue = 56)]
public int Period8 { get; set; }
[Parameter("Period10-Buy", DefaultValue = 23)]
public int Period10 { get; set; }
[Parameter("Period11-Sell", DefaultValue = 49)]
public int Period11 { get; set; }
[Parameter("Period12-Buy", DefaultValue = 39)]
public int Period12 { get; set; }
[Parameter("Period13-Sell", DefaultValue = 37)]
public int Period13 { get; set; }
[Parameter("Period14-Sell", DefaultValue = 26)]
public int Period14 { get; set; }
[Parameter("Period15-Sell", DefaultValue = 57)]
public int Period15 { get; set; }
[Parameter("Period16-Sell", DefaultValue = 51)]
public int Period16 { get; set; }
[Parameter("Volume-Buy", DefaultValue = 10000)]
public int Volume { get; set; }
[Parameter("Volume1-Sell", DefaultValue = 10000)]
public int Volume1 { get; set; }
[Parameter("StopLoss-Buy", DefaultValue = 56)]
public int StopLoss { get; set; }
[Parameter("StopLoss1-Sell", DefaultValue = 58)]
public int StopLoss1 { get; set; }
[Parameter("TakeProfit-Buy", DefaultValue = 112)]
public int TakeProfit { get; set; }
[Parameter("TakeProfit1-Sell", DefaultValue = 105)]
public int TakeProfit1 { get; set; }
[Parameter("MA_period1-Buy", DefaultValue = 75)]
public int MA_period1 { get; set; }
[Parameter("MA_period2-Buy", DefaultValue = 34)]
public int MA_period2 { get; set; }
[Parameter("MA_period3-Sell", DefaultValue = 66)]
public int MA_period3 { get; set; }
[Parameter("MA_period4-Sell", DefaultValue = 47)]
public int MA_period4 { get; set; }
[Parameter("MA_period5-Buy", DefaultValue = 54)]
public int MA_period5 { get; set; }
[Parameter("MA_period6-Buy", DefaultValue = 35)]
public int MA_period6 { get; set; }
[Parameter("MA_period7-Buy", DefaultValue = 44)]
public int MA_period7 { get; set; }
[Parameter("MA_period8-Sell", DefaultValue = 27)]
public int MA_period8 { get; set; }
[Parameter("MA_period10-Buy", DefaultValue = 68)]
public int MA_period10 { get; set; }
[Parameter("MA_period11-Buy", DefaultValue = 34)]
public int MA_period11 { get; set; }
[Parameter("MA_period20-Sell", DefaultValue = 68)]
public int MA_period20 { get; set; }
[Parameter("MA_period21-Sell", DefaultValue = 30)]
public int MA_period21 { get; set; }
[Parameter("Tral_Start-Buy", DefaultValue = 227)]
public int Tral_Start { get; set; }
[Parameter("Tral_Start1-Sell", DefaultValue = 216)]
public int Tral_Start1 { get; set; }
[Parameter("Tral_Stop-Buy", DefaultValue = 163)]
public int Tral_Stop { get; set; }
[Parameter("Tral_Stop1-Sell", DefaultValue = 184)]
public int Tral_Stop1 { get; set; }
[Parameter("MFI_period- Buy,Sell", DefaultValue = 22)]
public int MFI_period { get; set; }
[Parameter("MFI_period1-Sell", DefaultValue = 9)]
public int MFI_period1 { get; set; }
[Parameter("MFI_period2-Buy", DefaultValue = 11)]
public int MFI_period2 { get; set; }
[Parameter("MO_period-Buy", DefaultValue = 28)]
public int MO_period { get; set; }
[Parameter("MO_period1-Sell", DefaultValue = 32)]
public int MO_period1 { get; set; }
[Parameter("MO_period2-Sell", DefaultValue = 12)]
public int MO_period2 { get; set; }
[Parameter("MO_period3-Buy", DefaultValue = 5)]
public int MO_period3 { get; set; }
[Parameter("MO_period6", DefaultValue = 8)]
public int MO_period6 { get; set; }
private ChaikinMoneyFlow MFI;
private ChaikinMoneyFlow MFI2;
private MoneyFlowIndex MFI3;
private MomentumOscillator MO;
private MomentumOscillator MO1;
private MomentumOscillator MO3;
private VerticalHorizontalFilter MO4;
private VerticalHorizontalFilter MO7;
protected override void OnStart()
{
_GHLsmawws5Indicator = Indicators.GetIndicator<GHLsmawws5>(Period, Period1);
_GHLsmawws6Indicator = Indicators.GetIndicator<GHLsmawws6>(Period4, Period5);
_gannHighLowwws2Indicator = Indicators.GetIndicator<GannHighLowwws2>(Period2, Period3);
_gannHighLowtriIndicator = Indicators.GetIndicator<GannHighLowtri>(Period6);
_gannHighLowtri1Indicator = Indicators.GetIndicator<GannHighLowtri1>(Period7);
_gannHighLowWeightIndicator = Indicators.GetIndicator<GannHighLowWeight>(Period8);
_GHExpIndicator = Indicators.GetIndicator<GHExp>(Period10);
_GHExp1Indicator = Indicators.GetIndicator<GHExp1>(Period11);
_gannHighLowsmatriIndicator = Indicators.GetIndicator<GannHighLowsmatri>(Period12);
_gannHighLowsmatri1Indicator = Indicators.GetIndicator<GannHighLowsmatri1>(Period13);
_gannHighLowWeightedIndicator = Indicators.GetIndicator<GannHighLowWeighted>(Period14);
_GHLsmawws7Indicator = Indicators.GetIndicator<GHLsmawws7>(Period15, Period16);
MFI = Indicators.ChaikinMoneyFlow(MFI_period);
MFI2 = Indicators.ChaikinMoneyFlow(MFI_period1);
MFI3 = Indicators.MoneyFlowIndex(MFI_period2);
MO = Indicators.MomentumOscillator(MarketSeries.Close, MO_period);
MO1 = Indicators.MomentumOscillator(MarketSeries.Close, MO_period1);
MO3 = Indicators.MomentumOscillator(MarketSeries.Close, MO_period2);
MO4 = Indicators.VerticalHorizontalFilter(MarketSeries.Close, MO_period3);
MO7 = Indicators.VerticalHorizontalFilter(MarketSeries.Close, MO_period6);
MA1 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period1);
MA2 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period2);
MA3 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period3);
MA4 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period4);
MA5 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period5);
MA6 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period6);
MA7 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period7);
MA8 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period8);
MA10 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period10);
MA11 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period11);
MA20 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period20);
MA21 = Indicators.SimpleMovingAverage(MarketSeries.Close, MA_period21);
}
protected override void OnPositionOpened(Position openedPosition)
{
_position = openedPosition;
if (_position.TradeType == TradeType.Buy)
{
Trade.ModifyPosition(openedPosition, _position.EntryPrice - StopLoss * Symbol.PipSize, _position.EntryPrice + TakeProfit * Symbol.PipSize);
Print("StopLoss and TakeProfit were successfully established");
}
if (_position.TradeType == TradeType.Sell)
{
Trade.ModifyPosition(openedPosition, _position.EntryPrice + StopLoss1 * Symbol.PipSize, _position.EntryPrice - TakeProfit1 * Symbol.PipSize);
Print("StopLoss and TakeProfit were successfully established");
}
}
protected override void OnBar()
{
double Bid = Symbol.Bid;
double Ask = Symbol.Ask;
double Point = Symbol.PointSize;
double MO2 = MO.Result[MO.Result.Count - 2];
double MO10 = MO7.Result[MO7.Result.Count - 2];
double MFI1 = MFI.Result[MFI.Result.Count - 2];
if (Trade.IsExecuting)
return;
if (_GHLsmawws5Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO2 > 99.5 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHLsmawws5Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO2 > 99.5 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowwws2Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA5.Result.IsRising() && MA6.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO2 > 99.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowwws2Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO2 > 99.5 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowwws2Indicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA5.Result.IsRising() && MA6.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO10 > 0.65 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowwws2Indicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MO10 > 0.65 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHLsmawws5Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MO4.Result.IsRising() && MFI.Result.IsRising() && MO2 > 99.5 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHLsmawws5Indicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MO4.Result.IsRising() && MFI.Result.IsRising() && MFI1 > -0.05 && MO2 > 99.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowWeightIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MO4.Result.IsRising() && MFI3.Result.IsRising() && MO2 > 100.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHExpIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MO2 > 100.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHExpIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MFI1 > 0.15 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHExpIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MO10 > 0.65 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowsmatriIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MO2 > 100.05 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowsmatriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MO2 > 100.15 && MFI1 > -0.05 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowtriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA1.Result.IsRising() && MA2.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MFI1 > 0.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowtriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MA7.Result.IsRising() && MFI3.Result.IsRising() && MFI1 > 0.0 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowtriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MO4.Result.IsRising() && MFI3.Result.IsRising() && MFI1 > 0.1 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowtriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA10.Result.IsRising() && MA11.Result.IsFalling() && MO.Result.IsRising() && MFI.Result.IsRising() && MFI1 > 0.1 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowtriIndicator.Result.HasCrossedAbove(MarketSeries.Open, 1) && MA5.Result.IsRising() && MA6.Result.IsRising() && MO4.Result.IsRising() && MFI3.Result.IsRising() && MFI1 > 0.05 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_gannHighLowWeightIndicator.Result.HasCrossedBelow(MarketSeries.Open, 1) && MA5.Result.IsRising() && MA6.Result.IsRising() && MO4.Result.IsRising() && MFI.Result.IsRising() && MFI1 > 0.0 && MO2 > 100.5 && d == 0)
{
Trade.CreateBuyMarketOrder(Symbol, Volume);
Print("Trade Buy was successfully open");
d = 1;
}
if (_GHLsmawws7Indicator.Result.HasCrossedAbove(MarketSeries.Close, 2) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 100.1 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws7Indicator.Result.HasCrossedAbove(MarketSeries.Close, 2) && MA20.Result.IsFalling() && MA21.Result.IsRising() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 100.1 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws7Indicator.Result.HasCrossedAbove(MarketSeries.Close, 2) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO10 < 0.3 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws6Indicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsFalling() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws6Indicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsFalling() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO10 < 0.3 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws7Indicator.Result.HasCrossedAbove(MarketSeries.Close, 2) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MO3.Result.IsRising() && MFI2.Result.IsFalling() && MO2 < 100.1 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHLsmawws7Indicator.Result.HasCrossedAbove(MarketSeries.Close, 2) && MA20.Result.IsFalling() && MA21.Result.IsRising() && MO3.Result.IsRising() && MFI2.Result.IsFalling() && MO2 < 100.0 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowtri1Indicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsFalling() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHExp1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHExp1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA20.Result.IsFalling() && MA21.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHExp1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO10 < 0.4 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_GHExp1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MFI1 < -0.05 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowsmatri1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowsmatri1Indicator.Result.HasCrossedAbove(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO10 < 0.35 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowWeightedIndicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowWeightedIndicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA20.Result.IsFalling() && MA21.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MO2 < 99.8 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowWeightedIndicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA3.Result.IsFalling() && MA4.Result.IsRising() && MA8.Result.IsFalling() && MFI.Result.IsFalling() && MFI1 < -0.05 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
if (_gannHighLowWeightedIndicator.Result.HasCrossedBelow(MarketSeries.Close, 1) && MA20.Result.IsFalling() && MA21.Result.IsRising() && MO1.Result.IsFalling() && MFI.Result.IsFalling() && MFI1 < -0.05 && d == 0)
{
Trade.CreateSellMarketOrder(Symbol, Volume1);
Print("Trade SELL was successfully open");
d = 1;
}
foreach (var position in Account.Positions)
{
if (position.SymbolCode == Symbol.Code)
{
if (position.TradeType == TradeType.Buy)
{
if (Bid - position.EntryPrice >= Tral_Start * Point)
if (Bid - Tral_Stop * Point >= position.StopLoss)
Trade.ModifyPosition(position, Bid - Tral_Stop * Point, position.TakeProfit);
}
if (position.TradeType == TradeType.Sell)
{
if (position.EntryPrice - Ask >= Tral_Start1 * Point)
if (Ask + Tral_Stop1 * Point <= position.StopLoss)
Trade.ModifyPosition(position, Ask + Tral_Stop1 * Point, position.TakeProfit);
}
}
}
}
protected override void OnPositionClosed(Position pos)
{
d = 0;
}
protected override void OnStop()
{
Print("Successful day!");
}
}
}
Mountain
Joined on 28.07.2018
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: CADJPY2.algo
- Rating: 5
- Installs: 2461
- Modified: 13/10/2021 09:55
Comments
Hi there,
I have tested this cBot and you have done a great job. I tried to email, however your email address bounced back and I was hoping to talk in more detail about this. Please can you post your valid email or contact me so that we can discuss.
Many thanks
J
Hello,
I have read this email and perhaps I can reach you. If you are still interested in my cBots plaese write a short email to we.kroess@gmail.com.
W.