Topics
Replies

firemyst
18 May 2023, 08:07

I have been quite happy using Pepperstone as they give me 500:1 leverage and are regulated in multiple countries.


@firemyst

firemyst
18 May 2023, 08:04

RE:

PrincipalQuant said:

I'm facing a performance issue with cTrader version 4.7.9 on my two laptops.

I've noticed that when I carry out backtesting, the CPU usage remains low, despite setting the platform to use 100% of the CPU.
This is causing a significant slowdown in the speed of my backtesting process, which is impacting my ability to effectively use software for bot optimization.

Previously, I didn't experience this issue. The software was able to utilize the full potential of my CPU during backtesting, which allowed for a more efficient and faster processing time.
This is why the current situation is quite puzzling.

For your reference, I have send the report from desktop application.
Additionally, this issue is being experienced on two different laptops.

I've tried some basic troubleshooting steps such as restarting the laptops, reinstalling the software, and ensuring that there are no other intensive programs running in the background, but none of these steps have resolved the issue.

I would greatly appreciate it if you could look into this matter and provide me with any possible solutions or steps that I can take to resolve this problem.

I look forward to your response.

Also, just for kicks, have you set your Windows Laptops to utilize any GPU's you have installed by default? It might be that your laptop is passing off the workload to the GPU instead of the CPU.


@firemyst

firemyst
17 May 2023, 04:57

Here's some code that will give you a start on how to do it:

 


@firemyst

firemyst
17 May 2023, 03:17

RE: RE:

jim.tollan said:

firemyst said:

That is one thing that is soooooooooooooooooo annoying with the API's Spotware created as they're not consistent across indicators.

I wrote my own multi time frame fractal indicator. Basically, I did it by getting the bars data series time frame I wanted, and then doing the calculations (eg, looking for the midpoint between x number of bars, making sure "x" is an odd number).

 

Is this something that you'd be willing to share?? I'm not so interested in a visual indicator,. I'm more interested in using the data generated from the multiple instances... You of course kindly point out an approach, but it would be nice to have (even a cut down) version of the code if that wasn't giving away any IP.

cheers

jim

 

1) Go to the top of this webpage and under "algorithms", select "indicators".

2) Click the magnifying glass search icon on the top right

3) in the search box, put in the word "fractals" and then click search

4) discover how the world is your oyster with all the samples you find

 

 


@firemyst

firemyst
16 May 2023, 05:46

You may have to be a bit more specific, because how do you know what prices levels of the assets you have will be in "advance" since that is used in determining the amount of margin you have?


@firemyst

firemyst
16 May 2023, 05:43

That is one thing that is soooooooooooooooooo annoying with the API's Spotware created as they're not consistent across indicators.

I wrote my own multi time frame fractal indicator. Basically, I did it by getting the bars data series time frame I wanted, and then doing the calculations (eg, looking for the midpoint between x number of bars, making sure "x" is an odd number).

 


@firemyst

firemyst
15 May 2023, 13:15

RE: RE:

sifneos4fx said:

This is a prototype of scalping Bot.

Rules:

  • Timeframe: 1 Minute. May also work on 5 minutes 
  • Stochastic K% < 20 and Stochastics K% > Stochastics D%
  • Stochsastic K% should rising
  • RSI should rising
  • Close on Stochsatics K% > 80

Play with parameters ans let me know what you think.

 

using System;
using System.Linq;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
using cAlgo.Indicators;

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.CentralEuropeanStandardTime, AccessRights = AccessRights.None)]


    public class NewcBot : Robot
    {
        private MovingAverage EMA_Fast;
        private MovingAverage EMA_Slow;
        private StochasticOscillator Stochastics;
        private RelativeStrengthIndex RSI;

        protected override void OnStart()
        {
            EMA_Fast = Indicators.ExponentialMovingAverage(MarketSeries.Close, 50);
            EMA_Slow = Indicators.ExponentialMovingAverage(MarketSeries.Close, 100);
            Stochastics = Indicators.StochasticOscillator(9, 3, 9, MovingAverageType.Exponential);
            RSI = Indicators.RelativeStrengthIndex(MarketSeries.Close, 14);
        }

        protected override void OnTick()
        {
            if ((Server.Time.Hour > 17) && (Server.Time.Hour < 22))
                return;

            if ((NoOrders()) && (RSI.Result.IsRising()) && (EMA_Fast.Result.LastValue > EMA_Slow.Result.LastValue) && (EMA_Fast.Result.IsRising()) && (Stochastics.PercentK.IsRising()) && (Stochastics.PercentK.LastValue < 20) && (Stochastics.PercentK.LastValue > Stochastics.PercentD.LastValue))
            {
                ExecuteMarketOrder(TradeType.Buy, Symbol, 100000, "Stochastics Scalping", 10, 12);
            }

            if ((Stochastics.PercentK.LastValue > 80))
            {
                foreach (Position pos in Positions)
                {
                    if (pos.SymbolCode == Symbol.Code)
                        ClosePosition(pos);
                }
            }
        }

        protected override void OnStop()
        {
            // Put your deinitialization logic here
        }

        bool NoOrders()
        {
            foreach (Position pos in Positions)
            {
                if (pos.SymbolCode == Symbol.Code)
                    return false;
            }

            foreach (PendingOrder po in PendingOrders)
            {
                if (po.SymbolCode == Symbol.Code)
                    return false;
            }

            return true;
        }
    }
}

 

Just for kicks, I've been running on one of my VPS's against a demo account across 26 forex pairs M1 timeframe. So far one 0.7pip winner and 6 losses.

 


@firemyst

firemyst
15 May 2023, 11:55

RE:

david.o.levy said:

Are there any apps one can use to capture execution speed using cTrader over a defined period of time (ie 24 hours). 

What do you mean by "execution speed"? How fast orders are executed? Or how fast your custom indicators/bots run? Or something else?

 

The first should be written to the logging tab;

the second one you can put in your C# code statements that capture how fast methods execute and write out the results to the log tab


@firemyst

firemyst
15 May 2023, 11:52

I have multiple bots and bot instances running on Windows Server 2012 that do not through errors whether full access or no access.

So the issue is something in your actual code, which nobody would be able to help with unless you're able to:

1) post your entire code or

2) debug and narrow it down to a certain section of code to post that or

3) post sample code that reproduces the issue


@firemyst

firemyst
15 May 2023, 11:50

RE:

Goulk said:

Hello to all,
I have a question for you, can you create an action that repeats every (X PIP) away ?

Example:

On EURUSD
Every 10 PIPS away from PRICE X, OPEN ONE POSITION.

If possible, I need an example because I am not very practical. 

Thank you for your time
 :D

 

Some sample code to do something every x pips going long:


if (currentPrice >= priceX + (Symbol.PipSize * 10))
{
     //do what you want when you want to be at least 
     //10 pips higher than the last time you entered
}

 


@firemyst

firemyst
14 May 2023, 10:36 ( Updated at: 21 Dec 2023, 09:23 )

RE:

swansonconfidential said:

Very interesting, thank you!!

Have you tried it out? I would be really interested to hear if you saw much improvement from implementing this!

Also, does this mean it only work with Nvidia Graphics cards? Mine is AMD.

Thanks again!

It's a setting in Windows, so try it and see for yourself if it works for AMD and if so, how much of an improvement you see.

Also when running your next back test, right-click on your Windows task bar, select "task manager", and watch the GPU usage if it changes at all:


@firemyst

firemyst
14 May 2023, 10:33

What error messages, if any, do you receive?

Have you tried putting lots of Print statements through your code to see what values are written in the logging tab?

Ex:



Print("LSH {0}, SA {1}", lastSwingHigh, Symbol.Ask);

if (!double.IsNaN(lastSwingHigh) && Symbol.Ask < lastSwingHigh)
            {
                double takeProfitPrice = Math.Max(zigzag.SwingLow.Last(2), zigzag.SwingLow.Last(3));

Print("TPP: {0}, {1}, {2}", takeProfitPrice, zigzag.SwingLow.Last(2), zigzag.SwingLow.Last(3));

                if (double.IsNaN(takeProfitPrice))
                    return;

                double takeProfitPips = (int)((lastSwingHigh - takeProfitPrice) / Symbol.PipSize) * RiskRewardRatio;
                double stopLossPips = (int)((lastSwingHigh - Symbol.Ask) / Symbol.PipSize);

Print("TPP {0}, SLP {1}", takeProfitPips, stopLossPips);

                ExecuteMarketOrder(TradeType.Sell, SymbolName, 1000, "SwingZigZagStrategy", stopLossPips, takeProfitPips);
            }

 


@firemyst

firemyst
14 May 2023, 10:22 ( Updated at: 21 Dec 2023, 09:23 )

If you are running cTrader on a native Windows machine with an Nvidia gfx card, then you can try setting Windows to use the GPU more instead of the CPU in Windows:


@firemyst

firemyst
14 May 2023, 10:19

Try the solution in this thread to clear the local cache in cTrader:

 

Your same issue was happening to me.


@firemyst

firemyst
14 May 2023, 10:16 ( Updated at: 21 Dec 2023, 09:23 )

RE:

dynamites said:

Hello.

It would be great to have immediately an idea of the total amount of a combination of trades. This helps the trader to make a decisions to close or not.

Moreover, a button in the dropdown list like "select all" and "deselect all" would be paramount, especially if you scalp like me.

When you have a long list of open trades, the trade management in cTrader is quite "painful" to say the least...

There are some options available to you in the drop down menu:


@firemyst

firemyst
14 May 2023, 10:13

RE:

mh17462 said:

In which part of the website can I see a list of all the brokers who are working with you?

 

Well, for starters, if you really need this information, you could have:

1) looked on Spotware's website for a list of brokers:

2) used Google. "ctrader brokers list". Returns numerous pages. Here's one:

 

That took less than 5 minutes to do and should give you enough to go on.

 


@firemyst

firemyst
11 May 2023, 11:13

RE:

ncel01 said:

firemyst,

I can confirm the same discrepancy between cTrader desktop and cTrader mobile.

:

:

After all, as desired, you're able to sort all the trades in history, right?

 

 

Either way, it's a bug in how it operates, and I would hope @Spotware would want to fix it since their product is not working as expected.

 

 


@firemyst

firemyst
11 May 2023, 05:08

You can use it to gauge the strength/weakness of the indicator's trend.

Note that the angle can change depending on the zoom level of the chart


@firemyst

firemyst
11 May 2023, 05:05

What's the problem? Eg, why do you think it doesn't work?

Also, are you aware cTrader has HA candles built in, so you don't have to calculate them yourself -- just pass in the market data by choosing the appropriate timeframe. That is, Timeframe.HeinkinDay, etc.


@firemyst

firemyst
11 May 2023, 03:24 ( Updated at: 21 Dec 2023, 09:23 )

RE:

ncel01 said:

Hi firemyst,

Yes, it still can make sense.

As far as I can see, there is no mention to ascending/descending in cTrader desktop. This means that, most likely, what you consider to be a descending order has been defined as an ascending order.

This makes sense if the criteria is, for instance, the elapsed time between the closing and current times.

Ascending / Descending is right here on the column headings in cTrader desktop. Click on any column heading and it shows you how it's sorted

click on the heading again to reverse the sorting:

 

It's practically a universal standard that when you want date/times in descending order, it means you go from the most recent to the least recent, as showing in cTrader desktop:

 

And in any SQL database when you say, "SELECT * FROM myDatabase ORDER BY aDateTimeColumn DESC" any database will return the values sorted by "aDateTimeColumn" with the most recent date/timestamp first and continuing until the record with the oldest date/timestamp is last in the results.

So seeing how cTrader mobile is working, I suspect when @Spotware applies the filter, they mixed up ASC vs DESC in their data query.


@firemyst