Topics
Replies
firemyst
26 Oct 2023, 01:12
( Updated at: 26 Oct 2023, 05:35 )
It would be even better if you post this in the appropriate forum:
https://ctrader.com/forum/suggestions
@firemyst
firemyst
18 Oct 2023, 11:52
RE: RE: Is there any way to retrieve the bar's bar count at which the position was entered?
JINGXUAN said:
and it says :
‘Position[]’ does not contain a definition for ‘EntryTime’ and no accessible extension method ‘EntryTime’ accepting a fist argument of type ‘Position[]’ could be found
Of course it doesn't contain a definition. Your getting Long/Short positions returns arrays of Position objects; my example is with a single Position object.
The property “EntryTime” is for a single Position object, not an array of Position objects.
@firemyst
firemyst
07 Oct 2023, 13:28
( Updated at: 08 Oct 2023, 06:03 )
I suspect the cTrader team would only include support for .Net 8 and skip over the odd numbers.
As a product manager, why build in support for a product that Microsoft has said will only have a short term life span of just over a year?
.Net 8.0 will have long term support, and thus should have a life span until at least Nov 2026.
https://learn.microsoft.com/en-us/lifecycle/products/microsoft-net-and-net-core
@firemyst
firemyst
02 Oct 2023, 08:04
Take the date of the opening time of the bar before, and the first bar after.
then find the difference between the two, divide by 2, and add that to the opening time of the bar before the midpoint.
Ex:
open time to bar before is Sept 15, 6pm
open time of bar after is Sept 15, 8pm
Difference between them is 2 hours
2 / 2 == 1
6pm + 1 == 7pm.
@firemyst
firemyst
11 Sep 2023, 18:35
Another option you have is the following:
- hard code a date in your indicator/bot that's a day or two in the future
- check the date in your code against the Server.Time object
- if the server's time is > the time you have hard-coded in your code, have your code do nothing.
Example for a starting point. You'll obviously have to tweak it to fit your needs:
if (Server.TimeInUtc > new DateTime(2023, 9, 13))
return;
Since the cAlgo files are encrypted, nobody should hypothetically be able to crack and adjust your code; and they shouldn't be able to backwards adjust the Server's time either to bypass your time constraint because if they can, Spotware would have a gaping security hole there.
@firemyst
firemyst
11 Sep 2023, 18:21
When an exception happens, write out the values of any variables you want to a text file; then next time you start your bot, read the values in from the text file if it exists.
the text file can be saved as JSON data, CSV, or any other formats that you want to work with.
@firemyst
firemyst
27 Aug 2023, 15:26
You need to do something like this:
ChartText ct = Chart.DrawText("FB_Signal" + index, textFB, index, yFB, colorFB);
ct.VerticalAlignment = VerticalAlignment.Center;
ct.HorizontalAlignment = HorizontalAlignment.Left;
Play wit the Vertical and Horizontal alignments.
@firemyst
firemyst
26 Oct 2023, 01:18 ( Updated at: 26 Oct 2023, 05:35 )
It's not yet a feature in cTrader, and has been seriously lacking for some time - they need to up their game to keep up with the competition.
@firemyst