
Topics
Replies
PanagiotisCharalampous
26 May 2020, 16:10
Hi Vivek,
This is possible only with a netting account.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 14:36
Hi ajmal-ali,
You can add several indicators on your chart at the same time.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 14:18
Hi 4TRADERZFX,
This seems to be a problem on your computer, not a cTrader issue. Here are some suggestions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 14:16
Hi ajmal-ali,
It is not clear what do you mean with levels. Can you please explain?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 12:10
Hi Yuval,
It is in units.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 11:52
Hi john_7ko,
You can use this site to get color hex codes.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 11:49
Hi cool.ct4,
If you need somebody to program the cBot for you, you can consider posting a Job or contact a Consultant.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 11:46
Hi CuteLittleMay,
We need more information about this issue. Please can you please let us know the following.
1. What do you mean you changed cTrader ID? Did you create a new cTrader ID or did you just changed your email address? If you created a new cTrader ID, did your broker reassign your trading account to your new cTrader ID?
2. Please provide some screenshots of the issues you report so that we can understand what you see.
3. Please tell us your broker, your strategy name and provide the public link to your strategy.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 09:40
Hi Yuval,
In order to help you, we need to have the indicator code.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 09:34
Hi Yuval,
No there is not. If you want the source code to be available on the new computer then you will need to install the files one by one.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 09:22
Hi Yuval,
What do you mean when you say export?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 09:09
Hi noppapon,
There is no option to open a new chart using cTrader Automate API.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:51
Hi Yuval,
You don't need to create a position, you can retrieve it from Positions property.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:20
Hi beneditobvn,
In order for somebody to help you, you need to provide the following.
1. The complete cBot code
2. cBot parameters and backtesting settings and dates that will allow us to reproduce this problem
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:17
Hi Yuval,
You can use MarketData.GetBars(). to get bar data for another symbol. There you can find the close prices as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:14
Hi tobioluwatoki,
There was one build error which I fixed in the code below
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;
namespace cAlgo
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
//AccessRights.FullAccess
public class MT2cTrader : Robot
{
[Parameter("Orders Input File Path", DefaultValue = "C:\\Users\\trader\\AppData\\Roaming\\MetaQuotes\\Terminal\\69420FB8433504FEA0FA029C390238DB\\MQL4\\Files\\TradeCopy.csv")]
// C:\\Users\\trader\\CSV\\TradeCopy.csv
public string orders_input_file { get; set; }
[Parameter("Slippage", DefaultValue = 3.5)]
public double slippage { get; set; }
[Parameter("Delimiter", DefaultValue = ";")]
public string delimiter { get; set; }
protected override void OnStart()
{
}
private bool debug = true;
protected override void OnTick()
{
//todo, check M.D.
//price = marketDepth.AskEntries[0].Price;
//volume = marketDepth.AskEntries[0].Volume;
string[] lines = new String[0];
try
{
lines = File.ReadAllLines(orders_input_file);
} catch (Exception e)
{
Print("Exception: " + e.Message);
return;
}
List<string> existing_positions = new List<string>();
foreach (string line in lines)
{
OrderData order = new OrderData(line.Split(delimiter.Length > 0 ? delimiter[0] : ','), MarketData);
existing_positions.Add(order.label);
if (debug)
Print(line);
if (order.isCorrect() && (Positions.Find(order.label) == null))
ExecuteMarketOrder(order.type, order.symbol, order.lot, order.label, order.sl, order.tp, slippage);
}
for (int pos = 0; pos < Positions.Count; pos++)
if (!existing_positions.Contains(Positions[pos].Label))
ClosePosition(Positions[pos]);
}
}
public class OrderData
{
private const long mt_lot_coefficient = 100000;
//corrected_100000_july1
public Symbol symbol;
public TradeType type;
public long lot;
public int sl;
public int tp;
public string label;
private bool initialized_properly = true;
public OrderData(string[] raw_pieces, MarketData market_data)
{
try
{
this.label = raw_pieces[0].Trim();
this.symbol = market_data.GetSymbol(raw_pieces[1].Trim());
this.setType(Convert.ToInt32(raw_pieces[2].Trim()));
this.lot = Convert.ToInt64(this.parseDouble(raw_pieces[3]) * mt_lot_coefficient);
double price = this.parseDouble(raw_pieces[4]);
this.sl = this.getPipDistance(price, this.parseDouble(raw_pieces[5]));
this.tp = this.getPipDistance(price, this.parseDouble(raw_pieces[6]));
} catch (Exception e)
{
return;
}
{
this.initialized_properly = false;
}
}
public bool isCorrect()
{
return this.initialized_properly;
}
private double parseDouble(string value)
{
return double.Parse(value.Trim().Replace(',', '.'), System.Globalization.CultureInfo.InvariantCulture);
}
private void setType(int mt_type)
{
this.type = mt_type == 0 ? TradeType.Buy : TradeType.Sell;
}
private int getPipDistance(double basic_price, double close_price)
{
return Convert.ToInt32(Math.Round(Math.Abs(basic_price - close_price) / this.symbol.PipSize));
}
}
}
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:09
Hi Yuval,
You can consider writing information in files instead so that the information is not lost after the cBot is restarted.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:07
Hi Wojtek,
No there is no fix yet.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 08:05
Hi giogferrarizze,
In order for somebody to help you, you need to provide the following.
1. The complete cBot code
2. cBot parameters and backtesting settings and dates that will allow us to reproduce this problem
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 May 2020, 16:53
Hi Yuval,
Yes it does.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous