
Topics
Replies
PanagiotisCharalampous
20 Jan 2021, 08:09
Hi amirrezaik,
Try this
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.UTC, AccessRights = AccessRights.None)]
public class SampleRSIRobot : Robot
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter("Periods", DefaultValue = 5)]
public int Periods { get; set; }
[Parameter("Stop Loss (pips)", DefaultValue = 100, MinValue = 1)]
public int StopLoss { get; set; }
[Parameter("Take Profit (pips)", DefaultValue = 100, MinValue = 1)]
public int TakeProfit { get; set; }
[Parameter("Volume", DefaultValue = 10000, MinValue = 1000)]
public int Volume { get; set; }
private RelativeStrengthIndex rsi;
protected override void OnStart()
{
rsi = Indicators.RelativeStrengthIndex(Source, Periods);
}
protected override void OnBar()
{
if (rsi.Result.LastValue < 30)
{
Close(TradeType.Sell);
Open(TradeType.Buy);
}
else if (rsi.Result.LastValue > 70)
{
Close(TradeType.Buy);
Open(TradeType.Sell);
}
}
private void Close(TradeType tradeType)
{
foreach (var position in Positions.FindAll("SampleRSI", Symbol, tradeType))
ClosePosition(position);
}
private void Open(TradeType tradeType)
{
var position = Positions.Find("SampleRSI", Symbol, tradeType);
if (position == null)
ExecuteMarketOrder(tradeType, Symbol, Volume, "SampleRSI", StopLoss, TakeProfit);
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Jan 2021, 08:03
Hi prosteel1,
No, it is work in progress.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 14:44
Hi dnatan,
You can start from here. You can also consider posting a Job or contacting a Consultant to do this for you.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 14:41
Hi ang2681442,
You can try using this cBot.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 14:38
Hi 3rrr168,
There are many but you need to provide us with the complete source code and steps to reproduce so that we can understand what the issue is and propose the proper alternative.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 11:32
Hi abdulrahmanzakari007,
I cannot change the code since I don't know what are you trying to achieve. If you don't know how to program, maybe contact a Consultant to help you with this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 09:33
Hi abdulrahmanzakari007,
There are several ways to achieve this. Some of them are
- Use a flag
- Check if there are other positions opened
The correct solution depends on what your cBot logic is.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 09:16
Hi antoniogmd,
Can you explain what do you mean with "bar counting"?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 09:14
Hi 3rrr168,
Try this
protected override void OnTick()
{
if (myflag == 0)
{
myflag++;
ExecuteMarketOrder(TradeType.Buy, SymbolName, volumeInUnits1, myLabel, minusp, aaamt, "a1");
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 09:08
Hi wrbking,
cTrader Web 4.0 is not available for ICMarkets yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 09:03
Hi Bots4Us,
Q1; No this is not possible.
Q2: Not possible either
You can try using your own custom enum that will enable you control both of the above.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
19 Jan 2021, 08:42
Hi dnatan,
There is no built-in feature for this. You will need to develop something yourself.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 17:05
Hi prosteel1,
Unfortunately this will not be not a part of cTrader Desktop 4.0.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 14:54
Hi Stefan.olaru00,
Could you please check your Event Viewer for any possible messages that could help identify the issue?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 14:02
Hi again,
As far as I know after installation it should work fine.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 12:06
Hi firemyst,
The cloud is not assossiated with anything, it is a separate entity which is drawn between two lines. We have no plans for an on/off feature at the moment, but you can suggest it.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 11:14
Hi Bots4Us,
Unfortunately this information is not available via the API at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 10:55
Hi Bots4Us,
Unfortunately this information is not available via the API at the moment.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
18 Jan 2021, 10:46
Hi there,
It seems your ISP is blocking cTrader. Can you try installing cTrader using a VPN?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
20 Jan 2021, 08:14
Hi malas7malas,
To be honest, I did not understand what the problem is. Why don't you just stretch your charts vertically to get a better ratio?
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous