Topics
Replies
PanagiotisCharalampous
26 Feb 2020, 09:27
Hi A.R.
The API offers you the tools to check this. See below
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 NewcBot : Robot
{
[Parameter(DefaultValue = 0.0)]
public double Parameter { get; set; }
protected override void OnStart()
{
Positions.Opened += Positions_Opened;
ExecuteMarketOrder(TradeType.Buy, Symbol.Name, 1000, "", 0.1, null);
}
private void Positions_Opened(PositionOpenedEventArgs obj)
{
if (obj.Position.StopLoss == null)
{
// Handle the scenario where a stop loss was not set.
}
}
protected override void OnTick()
{
// Put your core logic here
}
protected override void OnStop()
{
// Put your deinitialization logic here
}
}
}
As per your comment
It is the responsibility of the contractor/receiver to execute or to say it can't.
We report to you that the Stop Loss has not been set. Any further decisions are trading decisions and it is not the job of the API to take trading decisions on behalf of the trader. This task should be a responsibility of the strategy/cBot. After all the cBot is a "contractor" itself.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 08:54
Hi 1222Ht,
Can you please provide the complete code you are using and exact steps to reproduce the problem?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 08:47
Hi David,
1) You cannot use a double in Bollinger Bands constructor. It needs to be a DataSeries object.
2) You can open and close positions for any instrument you want but the code you have written doesn't make much sense. You can find all positions in Positions collection To close a position use the position.Close() function.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 08:40
Hi chatcpe,
Please share the cBot code and cBot parameters so that we can reproduce the problem.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 08:38
Hi scalper1,
Send it to community@spotware.com
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 08:34
Ηι twoheartzin1soul,
You can use DrawTrendLine to achieve this.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 16:56
RE: staring to get som errors with the new update.
Hi scalper1,
Please post the cBot code in a separate thread and we will have look.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 14:56
Hi msdamgaci,
Can you explain in details what are you doing to get this message? Can share some screenshots as well?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 12:38
Hi elmpie,
Yes it will be available in the API as well.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 12:22
Hi A.R.
This is by design. Stop losses are set only after a position is opened but it is not possible to be set within the spread. It is the responsibility of the cBot developer to check if the stop loss has been succesfuly set and handle the situation if otherwise.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 11:24
RE: связанные графики и панель заказа
snaiperx11 said:
при нажатии на окно нового инструмента в панели заказа ордеров открывается соответствующий символ и те настройки стоп лосс и тейк которые были выставлены для данного инструмента
у меня открыто 2 графика
Gold and EUR\USD в панели заказов все правильно(Gold) , я нажимаю на график EUR\USD но панель заказа ордеров по прежнему Gold
Hi snaiperx11,
Please post your issues in English.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 11:06
Hi Douglas,
Price data is a responsibility of the broker. You need to address this issue with your broker.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 10:55
Hi Mr. John,
I am not sure why do you think this is an issue and what values would you expect to see. If the indicator is shifted backwards then there will not be any results in the latest bars.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 10:36
Hi Ben Floyd,
If you can share with us the exact steps you are following so that we can reproduce the problem, we can have a look at it and let you know if we have any suggestions.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 08:44
Hi barancansahin88,
I cannot reproduce the problem. The values change on every bar, see below.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
25 Feb 2020, 08:33
Hi Mihai,
The issue has not been fixed yet. You can find the correct links below
https://api.spotware.com/connect/profile?access_token=
https://api.spotware.com/connect/tradingaccounts?access_token=
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Feb 2020, 14:58
Hi genappsforex,
All positions have a TakeProfit and StopLoss property which are in absolute prices. What other closing price do you need?
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Feb 2020, 14:42
Hi koktos632,
No this is not supported.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
24 Feb 2020, 11:55
Hi Lisa,
Please send me the cBot code at community@spotware.com.
Best Regards,
Panagiotis
@PanagiotisCharalampous
PanagiotisCharalampous
26 Feb 2020, 10:16
Hi David,
No you can't. DataSeries is a series of values. A double is a single value. You will need to get the spread difference from a series of values before passing it to the BB indicator. I have the impression that you do not understand the API well. I would suggest you get some assistance from a professional instead of struggling with this yourself.
Best Regards,
Panagiotis
Join us on Telegram
@PanagiotisCharalampous