URGENT: STUCK IN TRADE!
URGENT: STUCK IN TRADE!
02 Aug 2016, 17:45
Hi.
As I'm writting I am currently stuck in trade. I can't close it because it says "POSITION_NOT_OPEN".
BUT in positions I can still see the trade, and my equity is moving. All the stoplosses are reset. I cannot exit the trade. At the moment it is in profit, but I want to exit trade asap.
Need help quickly.
Replies
cyfer
02 Aug 2016, 18:50
Don't know if your trade is still open , If it is Try to run this code
using System; 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.None)] public class CTDN_Close_ALL : Robot { protected override void OnStart() { } protected override void OnTick() { if (Positions.Count != 0) { var Trades = Positions.FindAll(""); foreach (var Trade in Trades) { ClosePosition(Trade); } } } protected override void OnStop() { } } }
@cyfer
cyfer
02 Aug 2016, 18:52
The forum is formatting the code in a very wrong way
The code is
////////////////////////////
using System;
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.None)]
public class CTDN_Close_ALL : Robot
{
protected override void OnStart()
{
}
protected override void OnTick()
{
if (Positions.Count != 0)
{
var Trades = Positions.FindAll("");
foreach (var Trade in Trades)
{
ClosePosition(Trade);
}
}
}
protected override void OnStop()
{
}
}
}
//////////////////////////////////////////////
There should be no bold or italic of any of that nonsense
@cyfer
cloesd
02 Aug 2016, 19:04
RE:
cyfer said:
The forum is formatting the code in a very wrong way
The code is
////////////////////////////
using System;
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.None)]
public class CTDN_Close_ALL : Robot
{
protected override void OnStart()
{
}
protected override void OnTick()
{
if (Positions.Count != 0)
{
var Trades = Positions.FindAll("");
foreach (var Trade in Trades)
{
ClosePosition(Trade);
}
}
}
protected override void OnStop()
{
}
}
}//////////////////////////////////////////////
There should be no bold or italic of any of that nonsense
I tried this.
It seems to be flooding the server with requests to close the trade, but the server is saying it's already closed
The error actually occured when Ctrader mysteriously DC'd mid-way through the trade.
I believe what's happening is my broker thinks the trade IS still open. But Ctrader's servers seem to think it's closed.
I've asked my broker to check on their end and they say that they can see the trade IS still open.
@cloesd
kricka
02 Aug 2016, 19:05
Close Position
If the above suggestions do not work try Close Positions 1.0 cBot.
Download; Close Positions 1.0
@kricka
cloesd
02 Aug 2016, 19:07
RE: Close Position
kricka said:
If the above suggestions do not work try Close Positions 1.0 cBot.
Download; Close Positions 1.0
How does the bot work? I'm afraid because it's not on Cbots websites it's linking to some other website.
In any case I don't think this problem can be solved client side. Hoping for a Ctrader reply, or other people who've had this problem.
@cloesd
kricka
02 Aug 2016, 19:12
RE: RE: Close Position
cloesd said:
kricka said:
If the above suggestions do not work try Close Positions 1.0 cBot.
Download; Close Positions 1.0
How does the bot work? I'm afraid because it's not on Cbots websites it's linking to some other website.
In any case I don't think this problem can be solved client side. Hoping for a Ctrader reply, or other people who've had this problem.
Just click on the download link and then install it from your download folder. And after installing it all you have to do is start the cbot. Then you see if you really have a position, by stoppen the cbot it will close the position.
@kricka
... Deleted by UFO ...
cloesd
02 Aug 2016, 17:46
RE:
cloesd said:
@cloesd