Topics
Replies

firemyst
23 May 2023, 16:48

RE: RE:

Nick24 said:

Yes, I agree. 

If Spotware wants to get on the same level as TradingView, ProRealTime, etc, and destroy Metatrader permanent, platform sync between every application is a must.

I don't know why they keep saying this is not possible while meanwhile TradingView and ProRealTime for instance are literally both having it.

I agree as well with what you said. Another example that's "kicking butt" is the mobile version of ThinkTrader from ThinkMarkets.

For regular time based bar charts, it's one of the best and easiest to use mobile platforms out there... I use it more than the cTrader mobile because even simple things like getting sorting history correct (issue raised here) appears to be problematic for Spotware on the mobile platform.


@firemyst

firemyst
22 May 2023, 10:14

RE: RE:

BJORNBERNAU said:

Thank you very much! 

This may well work,

 

 

 

It works for me as I use json files all the time to save parameters, status of bots, etc etc. :-)

As for adding it into cTrader by default (instead of having to program it through the API), I would post it to the "Suggestions" forum:

 


@firemyst

firemyst
22 May 2023, 03:31

Just out of curiosity, can you describe a few features that are in the web version that you'd like to see in the desktop version that currently aren't there?


@firemyst

firemyst
22 May 2023, 03:29

You could try adjusting your code so that your bots and indicators read/write your parameters to a json file.

Since you test your stuff in indicators first, the only actual input parameters that would have to be kept up to date are those for the indicator.

When your indicator runs, just write your parameters out to the json file.

Then when you start your bots, read in the json file to set all the parameters you need to. What I mean by that is, for example, you won't have to save the ticker-symbol nor the timeframe in the json parameter file, because you'll obviously set your bot instance to use the particular symbol/forex pair and timeframe you want to run against.

However, other parameters, like an EMA period or BB Std Dev, you'll probably want those saved to the json file.

 


@firemyst

firemyst
22 May 2023, 03:22

Good on you for having separate Dev/Production environments :-)

To answer your question, just copy the resulting .algo files over from one machine to the other, and double-click to install.

There's nothing fancy about it. Copy however you want (network share, memory stick, even by attaching to an email and then downloading the attachment on your trading machine)

On your live trading machine, just copy the algo files into the:

1) C:\Users\ [your windows username] \Documents\cAlgo\Sources\Robots for your robots

2) C:\Users\ [your windows username] \Documents\cAlgo\Sources\Indicators for your custom indicators


@firemyst

firemyst
21 May 2023, 08:52

This is probably a broker issue, not a cTrader issue. You need to speak with your broker.


@firemyst

firemyst
21 May 2023, 08:51 ( Updated at: 21 Dec 2023, 09:23 )

Within cTrader itself I don't think so. You can change the time zone, but since days start/end on midnight, the period separator will still appear whenever midnight happens regardless of the time zone you set:

So your best best would probably be either:

1) look for a custom indicator (or write your own) that draws a period separator at your desired time

2) set your time zone such that when it's midnight in that time zone, it's 5pm NY time.


@firemyst

firemyst
19 May 2023, 04:03

Did you even look or search on this site?

 


@firemyst

firemyst
19 May 2023, 03:48 ( Updated at: 20 May 2023, 16:17 )

RE: RE: RE: RE: RE:

meeting.chegini said:

Dear friend, do you want to teach me how to split the nucleus of an atom?

This is a simple question! If you know the solution, please guide me

How to split the nucleus of an atom: there's plenty of "how to's" on Google and YouTube already on how to do it.


@firemyst

firemyst
18 May 2023, 08:18

RE:

umadrat2012 said:

Hi guys,

I am getting the following error in my code and I cant seem to fix it

if (is_16_00 && Convert.ToBoolean(go_long))
            {
                double take_profit = Symbol.Ask + Symbol.PipSize * tp_value;
                var result = ExecuteMarketOrder(TradeType.Buy, Symbol.Name, Symbol.NormalizeVolume(0.1), Symbol.Ask, 1, 0, take_profit, "buy");
                if (result.IsSuccessful)
                {
                    Print("Buy order placed");
                }
                else
                {
                    Print("Buy order failed with error code: ", result.Error);
                }
            }

Errors

Symbol.Ask highlighted ,Cannot convert from double to bool
take_profit highlighted, Cannot convert double to string
"buy" highlighted, cannot convert from string to bool
 

 

You have the wrong parameters for your call to the ExecuteMarketOrder method.

For starters, no ExecuteMarketOrder API call takes a "double" (Symbol.Ask) as the 4th parameter.

 

 


@firemyst

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