PanagiotisCharalampous's avatar
PanagiotisCharalampous
26 follower(s) 0 following 1006 subscription(s)
Replies

PanagiotisCharalampous
18 Nov 2024, 06:34

RE: Inactive Status

firemyst said: 

An example of an even easier method, which I use, is:

if (Symbol.MarketHours.IsOpened())    { // market is open, do what you want }else    { //market is closed for the symbol. Do what you want }

Market hours are different to market sessions. Market hours are set by the broker. Market sessions are global.


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2024, 06:31

Hi there,

You can already do this. Just add an ATR indicator to your chart and then add an SMA and set the source to the ATR

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
18 Nov 2024, 06:24

RE: RE: RE: RE: No reply

MysticNic said: 

PanagiotisCharalampous said: 

MysticNic said: 

PanagiotisCharalampous said: 

Hi there,

Can you share a link to the thread?

Best regards,

Panagiotis

Thread was posted at 13 November with subject name “Position Manager” 

Can you please share the link?

I have a hard time trying to share the link so I’ll just copy and paste it here instead.

here it is:

“So here’s the thing, it’s been around 8-9 months since the risk-reward tool was launched in the web version and still to have this feature in desktop. Since this tool is still not available and I love cTrader I started looking for available Position Managers out there and guess what, all of the good ones out there have issues with Mac desktop. 

In my case a position manager like this is very important so I had to move to MT5 and purchase one there to trade. 

I say all this because it’s a petty to lose Traders for such things. CTrader for me is literally better than MT5 in every aspect but this one thing forced me to move to them. 
I’m sure there’s a whole bunch of traders out there that choose MT5 over cTrader for that one reason. I believe everyone would benefit if you guys do something about this.

All love, keep it up”

Thank you! The feature is under development, it should be available early next year.


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 16:47

RE: RE: "ACCESS_DENIED Error When Requesting Access Token via Open API"

Vasilios-G said: 

PanagiotisCharalampous said: 

Hi Vasilie,

Try using https://openapi.ctrader.com/apps/token to retrieve the token and let me know if this works.

Best regards,

Panagiotis

Hi Panagiotis,

Thank you for your reply.

I’ve tried using the suggested URL https://openapi.ctrader.com/apps/token in almost every possible place in my code, including replacing both the auth_url and token_url:

python

Code kopieren

# URLs for authentication and token retrieval self.auth_url = 'https://openapi.ctrader.com/apps/auth' self.token_url = 'https://openapi.ctrader.com/apps/token'

Unfortunately, despite these efforts, I’m still getting the "ACCESS_DENIED" error when trying to retrieve the access token.

Is there a specific way or place where this URL is supposed to be used that I might be missing? Also, would it be possible for someone to review my code or point out any common pitfalls I might be encountering?

Ελπίζω ειλικρινά να μπορέσετε να με βοηθήσετε περαιτέρω. Η υποστήριξή σας είναι ανεκτίμητη!

Με εκτίμηση,

Vasilios Gerasimou

Hi Vasilie,

Can you share a video demonstrating the exact steps you follow to receive this error, as well as the exact link for which the access is denied?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 16:45

RE: RE: I have a problem with counting pips in cbot

kudukmariusz said: 

PanagiotisCharalampous said: 

Hi there,

Please provide your complete code and explain to us how we can see what you are looking at. Also explain what you would expect to see instead.

Best regards,

Panagiotis

Hi, so the problem only occurs when I open positions, even when I tried to take the easiest example from the Internet where in the video it works normally, it doesn't work for me :( setting up pending positions works normally and I can set SL and TP as I like

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
    public class ThreeWhiteSoldiersAndThreeBlackCrows : Robot
    {
        [Parameter(DefaultValue = 1)]
        public double Volume { get; set; }

        [Parameter(DefaultValue = 200)]
        public double TakeProfit { get; set; }

        [Parameter(DefaultValue = 300)]
        public double StopLoss { get; set; }

        protected override void OnBar()
        {
        
            // Check if there are open positions
            if (HasOpenPositions())
                return;

            
            double Price_mine = Bars.ClosePrices.Last(1);
            
            // Three White Soldiers
            if (Bars.ClosePrices.Last(1) > Bars.OpenPrices.Last(1) &&
                Bars.ClosePrices.Last(2) > Bars.OpenPrices.Last(2) &&
                Bars.ClosePrices.Last(3) > Bars.OpenPrices.Last(3))
            {
                double stopLoss = Price_mine - (StopLoss * Symbol.PipSize);
                double takeProfit = Price_mine + (TakeProfit * Symbol.PipSize);

                ExecuteMarketOrder(TradeType.Buy, SymbolName, Volume, "ThreeWhiteSoldiers", stopLoss, takeProfit);
            }

            // Three Black Crows
            if (Bars.ClosePrices.Last(1) < Bars.OpenPrices.Last(1) &&
                Bars.ClosePrices.Last(2) < Bars.OpenPrices.Last(2) &&
                Bars.ClosePrices.Last(3) < Bars.OpenPrices.Last(3))
            {
                double stopLoss = Price_mine + (StopLoss * Symbol.PipSize);
                double takeProfit = Price_mine - (TakeProfit * Symbol.PipSize);

                ExecuteMarketOrder(TradeType.Sell, SymbolName, Volume, "ThreeBlackCrows", stopLoss, takeProfit);
            }
        }
          private bool HasOpenPositions()
        {
            foreach (var position in Positions)
            {
                if (position.SymbolName == SymbolName)
                    return true;
            }
            return false;
        }
    }
}

Even if I enter the number of pips directly into the Execute Order function, the bot still sets my SL and TP to over 2k pips.

Hi there,

The example you provided uses price levels as a stop loss and take profit. If it still doesn't work when you use pips, please share the updated code and screenshots demonstrating what happens.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 16:39

RE: RE: No reply

MysticNic said: 

PanagiotisCharalampous said: 

Hi there,

Can you share a link to the thread?

Best regards,

Panagiotis

Thread was posted at 13 November with subject name “Position Manager” 

Can you please share the link?


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 16:37

RE: RE: RE: RE: Bollinger Bands on RSI(or CCI) with unseen MACD

lbwforex said: 

PanagiotisCharalampous said: 

lbwforex said: 

PanagiotisCharalampous said: 

Hi Louis,

Thanks for your kind words. I am not sure why you got the impression that the source in Bollinger Bands cannot change. You can use any source you need. See below where you can do it

Best regards,

Panagiotis

 

Thank you for your reply. 

The issue is two fold. The MACD is still on the chart above the RSI using the MACD data. Maybe there is a way to remove the MACD and keep the the RSI using the MACD data? Then attaching the Bollinger Bands to the RSI does appear to be as easy changing the source parameters for the Bollinger Bands to the RSI, but the Source parameter is grayed out and cannot be changed. I tried to play around with the settings and could not achieve the singular subwindow with the Bollinger Bands on the RSI using the previous MACD data, (unseen same sub window). I am new to cTrader, so I hope there is a way to do this setup, because it is the best setup that exists, im my opinions. Please check it out. 

Thank you, 

Louis B.W.

 

Hi there,

The MACD is still on the chart above the RSI using the MACD data. Maybe there is a way to remove the MACD and keep the the RSI using the MACD data?

No the indicator needs to be on the chart in order to use it as a source. Alternatively, you need to code your own indicator.

but the Source parameter is grayed out and cannot be changed.

You need to add the source when you add the indicator on the chart. You cannot change it later. So make sure your RSI indicator is already on the chart before you add the Bollinger Bands indicator.

Best regards,

I tried that and it worked. Thank you. I plan on having all my indicators from MT4 converted over the cTrader. The Bollinger Bands in cTrader would be of better usefulness if levels could be added the Bollinger Bands because levels create signals when the RSI value crosses the levels. Can the levels be writting into a Bollinger Bands indicator? And an EA automatic software algorithm, cAlgo have Bollinger Band levels? Thank you. 

Hi there,

It is not possible to add levels in the built in Bollinger Bands indicator. But you can develop your own custom indicator and add levels if you wish, it should not be hard.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 16:29

Hi there,

You can use MarketSessions to achieve this. Check below

https://help.ctrader.com/ctrader-algo/guides/trading-sessions/

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:53

Hi there,

The files used to save optimization parameters are .optset files. I just tried this and looks good to me.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:50

RE: RE: RE: RE: How is the new EntryPrice (& thus Pips etc) of a modified or partially closed Position calculated?

martins said: 

Thank you that's very helpful. I hadn't fully realized “[modified CFD] Positions are just collections of deals traded in a FIFO manner”, even for netting accounts it seems (per https://match-trade.com/retail-hedge-account-vs-netting/ ), unlike stock trading trading where reducing a holding is often considered not to alter the average price (as in https://economics.stackexchange.com/questions/20464/how-to-calculate-average-buy-price-when-you-buy-sell-and-rebuy ).

I did try something experimental, not wanting real takeprofit or stoploss action, by keeping a calculated average EntryPrice as an override encoded in the StopLoss or TakeProfit (as 4 times the actual value so as not to trigger a real take or stop) and only needing to be maintained for volume alterations from the 1st time each position is reduced, so the adjustment to its pips/profit & balance could be made from then on. Probably not particularly useful, but can work without storing any ‘state data’ outside of cTrader if not wanting real take or stop, and without needing to track or read the whole history. 

A modifyable Position.Comment would be better, and useful for other purposes too, has it been considered?

Yes the product team is considering this


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:47

Hi there,

Please provide your complete code and explain to us how we can see what you are looking at. Also explain what you would expect to see instead.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:45

RE: RE: Sharpe Sortino Ratio Missing

robert.john.edgar said: 

PanagiotisCharalampous said: 

Hi there, 

Yes it has been removed permanently.

Best regards,

Panagiotis

Seems my local only just upgraded and removed sortino/sharpe.

Why did it get removed?

Is there any workaround for this or some plugin or other way we can get this?

My past experience with cTrader optimization is you get pretty poor results if you can't see either sharpe or sortino.

Hi there,

The previous calculation was not correct and the information required to properly calculate these metrics (risk free ratio) is not available in cTrader.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:42

RE: RE: RE: How to code Increase of lot size

GauchoHood said: 

GauchoHood said: 

PanagiotisCharalampous said: 

Hi there,

You can use the ModifyPosition method to change your position's volume.

Best regards,

Panagiotis

 

Hi Panagiotis. if (position.UnrealizedNetProfit >= profitThreshold)
{
   // Tried to adjust the volume
   double newVolume = position.VolumeInUnits * multiplier;
   position.ModifyPosition(newVolume); // Attempted this, but it did not work
}

attempted to use the ModifyPosition method to adjust the position's volume based on certain profit thresholds. Here’s the code I used:.

However, this did not work. Upon further reading, I discovered that ModifyPosition is designed to modify properties like stop loss and take profit, and not the position's volume.

Could you confirm if there’s a method or approach to modify the volume of an open position directly, or if this is strictly not supported in cTrader?

Hi there,

I quoted the wrong method, sorry. Here you go

https://help.ctrader.com/ctrader-algo/references/Trading/Positions/Position/?h=modifyvolum#modifyvolume

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
17 Nov 2024, 08:40

Hi there,

Can you share a link to the thread?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Nov 2024, 11:50

RE: travailler avec plusieurs comptes cTrader en même temps

lahutinieremichel said: 

Ah non ! 
J'ai parlé trop vite, l'environnement graphique est unique pour toutes les sessions !
Ce matin en préparant le travail pour la semaine prochaine, je découvre que l'environnement graphique que j'avais créé pour le deuxième compte a disparu au profit du premier compte.

Dommage, peut-être un axe de développement pour cTrade desktop ?

Il faudrait vraiment que l'équipe de développement puisse nous mettre en place que les sessions puissent être totalement indépendantes, j'imagine que nous sommes nombreux a utiliser plusieurs comptes en même temps.

Hi there,

Make sure you are using different workspaces on each profile.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Nov 2024, 11:47

Hi there,

Which application do you use and which broker is this?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Nov 2024, 11:45

Hi there,

You can use the ModifyPosition method to change your position's volume.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
16 Nov 2024, 11:42

Hi there,

Could you please send us some troubleshooting information the next time this happens? Please paste a link to this discussion inside the text box before you submit it.

Best regards,

Panagiotis
 


@PanagiotisCharalampous

PanagiotisCharalampous
16 Nov 2024, 11:40

Hi Vasilie,

Try using https://openapi.ctrader.com/apps/token to retrieve the token and let me know if this works.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 14:28

Hi there,

You first need to talk to ClickAlgo about this.

Best regards,

Panagiotis


@PanagiotisCharalampous