Description
OrglobalFxBOT Simple SSL V1.0
Tested on Renko
Telegram : @orglobalng
Logic: Takes and Close Trades by SSL flips
using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.WCentralAfricaStandardTime, AccessRights = AccessRights.None)]
public class OrglobalFxBOT_Simple_SSL : Robot
{
[Parameter("Volume", DefaultValue = 1000)]
public double _Volume { get; set; }
[Parameter("Length", DefaultValue = 20)]
public int _length { get; set; }
[Parameter("MA Type", DefaultValue = MovingAverageType.Simple)]
public MovingAverageType _MAType { get; set; }
private SSLChannel _ssl;
protected override void OnStart()
{
_ssl = Indicators.GetIndicator<SSLChannel>(_length, _MAType);
}
protected override void OnBar()
{
if (_ssl._sslUp.HasCrossedAbove(_ssl._sslDown, 1))
{
Close(TradeType.Sell, "OrgSSL");
Open(TradeType.Buy, "OrgSSL");
}
else if (_ssl._sslUp.HasCrossedBelow(_ssl._sslDown, 1))
{
Close(TradeType.Buy, "OrgSSL");
Open(TradeType.Sell, "OrgSSL");
}
}
private void Close(TradeType tradeType, string Label)
{
foreach (var position in Positions.FindAll(Label, SymbolName, tradeType))
ClosePosition(position);
}
private void Open(TradeType tradeType, string Label)
{
var position = Positions.Find(Label, SymbolName);
if (position == null)
{
ExecuteMarketOrder(tradeType, SymbolName, 1000, Label);
}
}
}
}
Orglobalfx01
Joined on 03.03.2021
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: OrglobalFxBOT_Simple_SSL.algo
- Rating: 0
- Installs: 1606
- Modified: 13/10/2021 09:54
Warning! Running cBots downloaded from this section may lead to financial losses. Use them at your own risk.
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
Man, try that on heikin ashi bars.