CT
ctid+customer-395444
7 follower(s) 0 following 845 subscription(s)
Topics
Replies

ctid+customer-395444
18 Apr 2023, 14:59

You could try using "cTrader Copy" and linking your accounts so they all copy off your one account.

 


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 14:58

I would add this here:

 


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 14:57

I would post this suggestion here:

 

 


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 14:56

I feel like it should work as you have it.

However, perhaps it's acting the way it does because with some brokers like IC Markets, users cannot trade in 0.01 lots. I believe their minimum is 0.1 lots. Maybe that's the issue?

I would try you code on two different brokers that allow for different sizes. For instance, Pepperstone allows for 0.01 lots, so try it with Pepperstone and then IC Markets and see what happens?


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 10:31 ( Updated at: 21 Dec 2023, 09:23 )

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 

I've sent through the information via the "report a technical issue" option in cTrader.

Here's a screen capture from cTrader now running on VPS with NAS Re8 chart. Notice the "deal maps":

 

Now check out the same chart on my local laptop:

You can see same chart (NAS Re8), but laptop (bottom capture) is missing at least 2 deals.

Same broker, same demo account.

Let me know what other information you may need from either machine.

 


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 09:33

I see in your code you're not capturing the trade result, which would tell you if it's successful or not.

See example:

 


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 09:31

No, you cannot start a bot programmatically (at least as of cTrader version 4.5.x). However, you can stop a cbot manually or programmatically.

 

"Is the ModifyStopLossPrice method able to be used from an Indicator?"

I'm not sure honestly as I've never tried. However, since you don't post your code that does it, are you sure the value you're passing in for "position" isn't null? Or actually has a reference to a valid, open trade?


@ctid+customer-395444

ctid+customer-395444
18 Apr 2023, 09:16

RE:

Samm193 said:

Dear All,

 

I want to add Renko Bars to my cbot.

By example, say the next Renko bars must be green, is this possible please?

How to code this in the bot please?

 

Thank You,

Renko bars can be added to your bot by either:

1) selecting a renko time frame and running the bot in the REnko time frame

2) in your bot code getting the Renko Bars programmatically

3) putting in logic within your cbot that measures every x pips with each tick to see if a new bar has been formed

4) using an indicator in your bot that does #3 already


@ctid+customer-395444

ctid+customer-395444
17 Apr 2023, 16:45 ( Updated at: 21 Dec 2023, 09:23 )

@Spotware! It's done it more times today! What's happened? This has only started since the 4.7.7 release on Renko charts.

Look at all the trades missing! One instance of cTrader running on VPS; the other cTrader running on a local computer.Both cTrader's have been restarted. How come the history entries are no longer syncing up?!

Look at all the trades missing from the other cTrader's history:


@ctid+customer-395444

ctid+customer-395444
17 Apr 2023, 02:38 ( Updated at: 21 Dec 2023, 09:23 )

Margin calculations vary by broker and currency used.

I would log into your broker's account and see what the actual margin calculator there suggests.

For example, this is what I get when using my broker's "margin calculator":

As you can see, it varies with each currency.

And cTrader displays values depending on what currency you have selected in the application. For example:

So since you don't state what currency your account is in, what currency cTrader is displaying as, and who your broker is, I hope the info I've provided above is enough to get you started in answering your question.


@ctid+customer-395444

ctid+customer-395444
16 Apr 2023, 05:52

I can see a potential issue on this line with sell orders:

ModifyPosition(position, TrailingStopStep * Symbol.PipSize, null);

 

You probably mean to use the following like you do under buy orders:

ModifyPosition(position, newStopLossPrice, null);

 

since the issue you have always only happens with sell orders.


@ctid+customer-395444

ctid+customer-395444
16 Apr 2023, 05:35

RE: RE: RE: RE: RE: RE: RE: RE:

Shares4us said:

@firemyst

But you still havne't posted sample code that "doesn't build" so others cna try reproducing the issue?

?????? What use has code when the problem is not syntactical or in the logic but in the dev environment itself!
If it was I'd posted (as many times before) a test code to prove the problem.
Please look at the images I posted in my inital post. Think about it and you will come to the conclusion it has NOTHING to do with code!

Best rgds,

All I'm suggesting is nobody else appears to be experiencing any issues running various versions of cTrader and building numerous indicators/cbots.

So to encourage people to further help you, you'll have to give people something else to go on.

That means code, the .sln file, the .csproj file, the .algo file, or everything.

Or some sampling that reproduces the issue so others can see what's happening, investigate, and perhaps give you an answer.

If you're not willing to do that, then you might be on your own.

 


@ctid+customer-395444

ctid+customer-395444
14 Apr 2023, 02:51

RE: RE: RE: RE: RE: RE:

Shares4us said:

@firemyst  

Thnks for the effort!

But sadly it does not change the fact it still builds no .algo file

 

That's unfortunate.

But you still havne't posted sample code that "doesn't build" so others cna try reproducing the issue?

According to your logs, it does build the calgo, but into the various C:\Users\Admin\Documents\cAlgo\Sources\Indicators\ [name of indicator] \bin\Release subfolders.

 

 


@ctid+customer-395444

ctid+customer-395444
13 Apr 2023, 14:24

I understand what you mean.

While the API is a good start, there's definitely lots of things that can be improved.

What annoys me the most so far is the API's for the indicators aren't standardized. For instance, there's a lot of indicators that do not accept a data series as a parameter; or other indicators like the MA's where some have the "shift" parameter, and others that use MA's don't.

And we still don't have an option to programmatically turn on/off any "cloud" attribute.

Go figure. :-/


@ctid+customer-395444

ctid+customer-395444
13 Apr 2023, 11:56

Then why not just create your own function that does the same thing?

Should be straight forward.

Just a simple for-loop going through each bar in the data series except the current bar, and compare the values?


@ctid+customer-395444

ctid+customer-395444
13 Apr 2023, 10:17

RE: RE:

yaghouti said:

i want to check some parameters on each tick and change the period1 from calculate,

would you mind please explain me how to do this task?

 

 

firemyst said:

It won't change unless you create a new MovingAverage with the new setting or overwrite the previous one.

So after you change "period1", you should do this again:

param1 = Indicators.MovingAverage(param2, period1, MovingAverageType.Simple);

The Initialize method will only run again if you display the parameters window and change it that way.

If you programmatically change values, then you need to programmatically create new movingaverage objects with those new parameters.

 

 

Not knowing everything you want to do, it's not that complicated. In a nutshell, it'll be similar to the following:

protected override void Calculate(int index)
{
// do some stuff or whatever you want to do

//check and change
if ( [whatever condition] == true)
{
  //set the new period1
  period1 = 12; //or whatever

  //update the MA
  param1 = Indicators.MovingAverage(param2, period1, MovingAverageType.Simple);
}

//do whatever else you need to

}

 

 


@ctid+customer-395444

ctid+customer-395444
13 Apr 2023, 03:49

What do you have for your "Period" setting?

According to the API documentation, the "HasCrossed" should look back the number of bars equal to "period" and see if the values have crossed during that time:

So if you have a period of 1, it should look back over the last 1 bars to see if the values have crossed. If you set period to 2, it should look over the last 2 bars to see if the values have crossed, etc etc.

If not, then please post sample code showing the issue so everyone can see what you're doing and how.

Thank you.


@ctid+customer-395444

ctid+customer-395444
13 Apr 2023, 03:44

It won't change unless you create a new MovingAverage with the new setting or overwrite the previous one.

So after you change "period1", you should do this again:

param1 = Indicators.MovingAverage(param2, period1, MovingAverageType.Simple);

The Initialize method will only run again if you display the parameters window and change it that way.

If you programmatically change values, then you need to programmatically create new movingaverage objects with those new parameters.


@ctid+customer-395444

ctid+customer-395444
12 Apr 2023, 12:54

RE: RE: RE: RE:

Shares4us said:

@firemyst 

Yes i'm on the automate tab (see the post on 30 Mar 2023, 19:36)
Yes it's an indicator, the problem is the same for an indicator or a Robot.
The problem is not in the use of the cTrader native build but in building with vs2022.

The build in vs2022 runs OK 

Build started...
1>------ Build started: Project: Test3, Configuration: Debug Any CPU ------
1>Test3 -> C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3\Test3\bin\Debug\net6.0\Test3.dll
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 10:53 AM and took 01.701 seconds ==========

but the

C:\Users\xxx\Documents\cAlgo\Sources\Indicators\Test3.algo

is not updated.

therefor debugging is not possible.

So the question is:
What 'extentions/procedures' does cTrader append to vs2022 to create/update the Test3.algo file and what makes it not working anymore.

 

If you have anything specified in VS 2022 like preferred framework, target platform, target OS, etc etc, it's going to build it in those local subfolders under "Bin" and "release/debug".

To stop this, you need to edit your VS Project file (via Notepad or some other text editor) and insert the following within the <PropertyGroup> tags:

    <AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
    <AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>

For example, here's mine from one project using .Net6:

<PropertyGroup>
    <TargetFramework>net6.0-windows10.0.20348.0</TargetFramework>
    <PlatformTarget>x64</PlatformTarget>
	<AppendTargetFrameworkToOutputPath>false</AppendTargetFrameworkToOutputPath>
	<AppendRuntimeIdentifierToOutputPath>false</AppendRuntimeIdentifierToOutputPath>
  </PropertyGroup>

 

 


@ctid+customer-395444

ctid+customer-395444
11 Apr 2023, 06:55 ( Updated at: 11 Apr 2023, 06:56 )

        protected override void Initialize()
        {
            // How to debug:
            // https://help.ctrader.com/ctrader-automate/debugging/#debugging-a-cbotindicator

#if DEBUG
                var result = System.Diagnostics.Debugger.Launch();
#endif
            // ...
            // ...
        }

 

Sample code above.

Link below:

 


@ctid+customer-395444