Thanks… so as soon as a trade is closed it is instantly added to the historical? If it's instant this solution will work…. but if there is a delay of say more than 1 second then I'll have to keep them in a list in my code.
I've encountered exactly this problem today. Desktop was working fine first thing, looked at something else, and when I went back to Desktop all that I could get was this white box. Have tried clean uninstall/reinstall etc as per instructions several times, but all that I ever get is the white box now (sometimes black) over the task bar. No actual screen in any shape or form, though I always get the ‘workspace has loaded successfully’ message on alleged booting up. Broker is mystified. Any ideas?
There is no option to access closed positions. You can only access past deals through History. Nevertheless if you want the information to persist between cBot restarts, you can always save it in a file
Do you have a code example of getting a trade out of history? Can it be done using a name or id? TIA
Hi, you misunderstand me. I don't want them to change color or become invisible. I don't want the list on the screen so that when I move my SL/TP - they don't get in the way.
You can track the closed positions using the Positions.Closed event. There you can add the closed positions in a collection as the one you posted above.
Best regards,
Panagiotis
Thanks… I don't care about the event, I need to be able to look up a history of closed/filled trades. For example before placing a trade for id XYZ123 I first need to make sure that trade id XYZ123 hasn't already been opened and closed… this is to prevent duplicate trades from occurring. And if I just add them to a collection I'll lose that collection of closed trades next time the cBot is restarted which will allow duplicate trades to occur. TIA
There is no option to access closed positions. You can only access past deals through History. Nevertheless if you want the information to persist between cBot restarts, you can always save it in a file
Could you pleasesend us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
Nothing out of the ordinary, there is a method of creating the box and then in Calculation it is repeated 10 times, to form part of the vertical line on the right.
public override void Calculate(int index) { for (int ib = 0; ib < 10; ib++) { //////////// ///--------------- ///////////
public ChartRectangle DrawMyRectangle(int ib, int ind, int start, int end, double currPrice, double by10, double MaxBoxIndex, double MinBoxIndex) { double sum = Xcind(ind, start, end); List<double> mSum = new(); mSum.Add(sum);
var Minut = TimeFrame.GetHashCode(); var newOffset = Minut * OffsetBox; var topbx = by10 - (by10 * 0.1); var btmbx = by10 - (by10 * 0.9); var newColor = sum > 0 ? Color.FromArgb(TranspBox, UpColor) : Color.FromArgb(TranspBox, DownColor);
//////////// ///--------------- ///////////
return rec; }
hi there,
I would need the full source code of the indicator to assist further
You should ask your broker to investigate from where these orders were executed. The broker can see from which application was the position opened. This could help you understand what is going on.
Could you pleasesend us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.
bro now its automatically hidden and I don't know how to find where to unhid it …. ive been struggling for 3 days now and can't find the awnser no where… anybody can help me?
Hi there,
Can you share a screenshot of what you are looking at?
You can track the closed positions using the Positions.Closed event. There you can add the closed positions in a collection as the one you posted above.
PanagiotisCharalampous
21 Sep 2024, 06:13
RE: RE: How to create a cBot using a custom indicator
a.datawhip said:
You can but you need to have the source code.
@PanagiotisCharalampous