Topics
Replies
firemyst
21 Apr 2023, 09:03
RE:
Spotware said:
Dear trader,
Unfortunately we were not able to reproduce this problem. Please provide us with the following information
- Please share the logs of each application.
- Please let us know which workspace you use in each application
- After you share the above information here, send us troubleshooting from both machines the next time this happens. Add a link to this discussion in the description.
Best regards,
cTrader Team
Hi everyone / @Spotware:
The issue appears to be resolved now.
What I had to do is the following:
1) Go into cTrader settings
2) General tab
3) click Reset local data to default
It took a little while to reload everything, but all the missing trades I was aware of are now showing on both my VPS and local laptop.
Thank you
@firemyst
firemyst
21 Apr 2023, 05:12
First of all, the error message says, "Access Denied". So have you tried granting your cBot full access?
Ex:
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
Second, if that doesn't work, and you've already added it as a "reference" to your solution in cTrader, then you'll probably have to use the DLL Import directive in C#.
And for that, I suggest you try using Google to find examples as there's plenty out there.
Blah blah blah :-)
@firemyst
firemyst
20 Apr 2023, 05:33
In a nutshell you don't if you're using the built in cTrader API.
You should use HorizontalAlignment and VerticalAlignment properties and whether it's Chart.DrawStaticText or Chart.DrawText methods.
If you don't like those options, then you can create a Windows Panel object with Labels/Text and place that on the chart. I can't tell you how to do that offhand, but I'm sure there are examples to be found.
@firemyst
firemyst
20 Apr 2023, 05:29
First, you'll probably want to get the current index:
int lastIndex = Bars.OpenTimes.GetIndexByTime(Bars.OpenTimes.LastValue)
Then you can loop over the last 5 indexes:
int low = Int32.MaxValue;
for (int x=lastIndex - 5; x <= lastIndex; x++)
{
if (Bars.LowPrices[x] < low)
low = Bars.LowPrices[x];
}
The above is all pseudo code so may not work exactly as is since I'm not in front of anything other than a tablet typing this.
If you want to find the index of another bar, assuming you're on a chart that's based on time (eg, not Renko or Range bars), then in the call to Bars.OpenTimes.GetIndexByTime, provide the time of the bar that you want.
Hope that helps?
@firemyst
firemyst
18 Apr 2023, 15:44
The Output has to be an IndicatorDataSeries.
If you want a public property that other indicators/cBots can access, then you have to remove the [Output] designation and leave it as a public property in your class.
//Example:
//Instead of this:
[Output("bearCrossActive")]
public bool bullCrossActive;
//You need to do this:
public bool bullCrossActive;
//or create your own indicator data series as an output:
public IndicatorDataSeries bullCrossActive
See this thread for some more information:
@firemyst
firemyst
18 Apr 2023, 15:23
( Updated at: 21 Dec 2023, 09:23 )
RE:
remon said:
Hello,
It would be nice to be able to show/hide an indicator inthe "Object Manager" screen the same way it's already possible for Drawings. This way you don't have to add/remove an indicator because you don't want to see it for a moment (and change all the settings). This makes the "Object manager" then a shortlist of used indicators which you only have to show/hide.
@firemyst
firemyst
25 Apr 2023, 09:20
When you do this:
it calls the Calculate method in the indicator.
You have a print statement in that method in your indicator.
@firemyst