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

PanagiotisCharalampous
30 Sep 2024, 06:33

Hi there,

Please share your cBot's code and exact steps to reproduce this issue (broker, backtesting parameters, dates)

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:31

RE: Where can I download latest version?

paul_leppard said: 

I've just downloaded version 5.0.20 but it seems the backtesting is not starting. The chart does not show and the play button is missing. Is this fixed in a later release? the only link I can find is the one from the Ctrader website at that downloads 5.0.20 Thanks. This is the MacOS version.

Hi there,

There is no known issue with backtesting at the moment. Please report your issue in a separate thread and provide more information about your problem e.g. screenshots/videos.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:29

Hi there,

Can you please provide a more detailed description of your problem please? Which application do you use? What exactly happens and what happens instead? Please use screenshots/videos to explain your issue clearly.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:23

RE: RE: MacOS App Backtesting

soskrr said: 

akhilascoder said: 

Backtesting is now available in Mac (Version 5.0 (20)). I'm using it for a while now.

Hi

How did you get the update?

 

Hi there,

The update should come automatically.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:21

Hi there,

Indicators implement a lazy loading pattern. So for the Calculate() method to be executed, you need to call the Result data source somewhere in your cBot's code before you call your custom method e.g.

var result = impulseSystem.Result.Last(0);
double systemBarColor = impulseSystem.GetLastElderColor();

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:10

RE: Risk-Reward Tool missing on the desktop version

gifted19911991 said: 

hey i dont have it on my desktop does it work now do i need to update my ctrader im using 5.0.28 if so how i update

Hi there,

Risk Reward tool has not been added yet on cTrader Desktop.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:06

Hi there,

Can you explain what the problem is?

Best regards

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 06:00

RE: RE: RE: RE: Updated email address

gravytrain17 said: 

PanagiotisCharalampous said: 

gravytrain17 said: 

PanagiotisCharalampous said: 

Hi there,

You need to create a cTrader ID with the correct email address and ask your broker to link your accounts to the new cTrader ID.

Best regards,

Panagiotis

Thanks for the prompt reply. 
What I don't understand is that I am getting emails from cTrader.com to my correct email address with my account statement. If the account is not linked, surely I would not receive those emails?
Which makes me wonder why I can't see my account when logging into cTrader.

Hi there,

You can see which accounts are linked to your correct cTrader ID in the link below

https://id.ctrader.com/my/settings/accounts

If your account is listed there but does not show on the cTrader platform, then you need to talk to your broker

Best regards,

Panagiotis

Thanks again,
I followed the link and the account is not listed there. The only one listed is my old trading account with another broker. I also logged out and logged in again to double check and it's not there.  What is puzzling is I got an email from cTrader with this cTrader ID showing my statement with my current broker and current account. So it appears to be linked somewhere however it's not showing up in my cTrader profile and account settings.

Hi there,

Can you share screenshots demonstrating this i.e. the email you received and the account not showing in the relevant list? In your screenshots, your email address, the account numbers and the cTrader ID need to be evident.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 05:49

RE: RE: My fix API access doesnt work

ctid8404604 said: 

PanagiotisCharalampous said: 

Hi there,

Please share the complete exchange of messages so that we can check what you are sending to the server.

Best regards,

Panagiotis

< 8=FIX.4.4|9=139|35=A|49=live.pepperstoneuk.2044182|56=cServer|34=1|52=20240926-13:02:29|57=QUOTE|50=QUOTE|98=0|108=1|553=2044182|554=*******|141=Y|10=137| > 8=FIX.4.4|9=114|35=5|34=1|49=cServer|50=QUOTE|52=20240926-13:02:29.957|56=live.pepperstoneuk.2044182|57=QUOTE|58=RET_INVALID_DATA|10=212|

Hi there,

It seems you are sending an invalid password. Please check your password.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 05:37

Hi there,

If you think this is a bug of CLI and not a user mistake, then you would need to document it with a bit more evidence e.g. some screenshots or videos showing this happening, as well as provide any other information that could help the team reproduce such a behavior.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
30 Sep 2024, 05:34

RE: RE: Found a bug using Indicators.. in Initialize method

jim.tollan said: 

PanagiotisCharalampous said: 

Hi there,

It works fine for me.

Can you try recreating the indicator?

Best regards,

Panagiotis

My apologies, I seem to be unable to create a new topic. 

Quick question. Can you explain why there have been no new cBots or indicators on your Algorithms section since 8th September? Normally, both those areas are pretty busy, but just seems to have drawn to a halt abruptly without any company PR/explanation. I personlly think this is bad for platform morale (the lack of comms) and makes you guys seem a little disconnected.

Anyway, apologies if it's just my login for some reason that's only seeing back to 8th September and if so, can you fix it for me -thanks

Hi there,

Now all new algorithms need to be uploaded to our store 

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Sep 2024, 06:28

Hi there,

Thanks for reporting this issue. We will fix it in an upcoming update.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Sep 2024, 05:32

Hi there,

Please share your cBot code and backtesting parameters so that we can reproduce this issue. Also check your cBot log in case of any useful messages.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Sep 2024, 05:31

RE: RE: Updated email address

gravytrain17 said: 

PanagiotisCharalampous said: 

Hi there,

You need to create a cTrader ID with the correct email address and ask your broker to link your accounts to the new cTrader ID.

Best regards,

Panagiotis

Thanks for the prompt reply. 
What I don't understand is that I am getting emails from cTrader.com to my correct email address with my account statement. If the account is not linked, surely I would not receive those emails?
Which makes me wonder why I can't see my account when logging into cTrader.

Hi there,

You can see which accounts are linked to your correct cTrader ID in the link below

https://id.ctrader.com/my/settings/accounts

If your account is listed there but does not show on the cTrader platform, then you need to talk to your broker

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Sep 2024, 05:26

Hi there,

Please share the complete exchange of messages so that we can check what you are sending to the server.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
27 Sep 2024, 05:23

Hi there,

It works fine for me.

Can you try recreating the indicator?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Sep 2024, 09:16

RE: RE: Positions.Count is returning 0 inside Positions_Opened()

ncel01 said: 

PanagiotisCharalampous said: 

Hi there,

Unfortunately we were not able to reproduce the problem. Positions amount shows correctly for us

Best regards,

Panagiotis

Panagiotis,

Can you please check this under the same conditions (broker, symbol, etc) ?

This way you'll be (obviously) more likely to be able to reproduce the issue.

Remark: It has been already noticed in the past that many issues that applied to indices were not applicable to forex.

Thanks.

We did but with no luck unfortunately. We will keep it in mind though in case we stumble upon it in any other occasion


@PanagiotisCharalampous

PanagiotisCharalampous
26 Sep 2024, 09:15

RE: RE: cBot onStop() Not Triggered When Running in the Cloud

Anus+ said: 

Hi Panagiotis,

Thank you for your response!

Since OnStop() is not called for cBots running in the cloud, I was wondering how I can ensure proper cleanup when stopping the cBot. Specifically, I’d like to close any open positions and delete any pending orders that were created by the cBot before it stops.

Is there any recommended approach or workaround to handle this in the cloud environment? For example, is there a way to automatically trigger such cleanups when the cBot is stopped manually in the cloud?

Thanks again for your help!

Best regards,

Anus+

Unfortunately there is no workaround at the moment. If your strategy depends on OnStop() method, then it is better not to execute it on the cloud but on your own VPS.


@PanagiotisCharalampous

PanagiotisCharalampous
26 Sep 2024, 05:20

RE: RE: Bots not working on .NET 6

calamejunior said: 

PanagiotisCharalampous said: 

Hi strakmi,

Any chance you can record a video demonstrating all this so that I can forward it to the product team to check?

Best Regards,

Panagiotis 

Join us on Telegram and Facebook


Hi can you look at my cbot let me know if it runs on your end 

// Created by Junior Calame
// Property of Raftman Capital © 2024. All rights reserved.

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

namespace cAlgo.Robots
{
   [Robot(TimeZone = TimeZones.EasternStandardTime, AccessRights = AccessRights.None)]
   public class EnhancedRangeBreakoutBot : Robot
   {
       // Parameters for Risk Management
       [Parameter("Risk Percentage", DefaultValue = 1.0)]
       public double RiskPercentage { get; set; }

       [Parameter("Stop Loss in Pips", DefaultValue = 20)]
       public int StopLossPips { get; set; }

       [Parameter("Take Profit in Pips", DefaultValue = 60)] // Increased take profit for better R:R ratio
       public int TakeProfitPips { get; set; }

       [Parameter("Enable Trailing Stop", DefaultValue = true)]
       public bool UseTrailingStop { get; set; }

       [Parameter("Trailing Stop in Pips", DefaultValue = 10)]
       public int TrailingStopPips { get; set; }

       [Parameter("Minimum Volatility Threshold (ATR Multiplier)", DefaultValue = 2.0)] // Adjusted multiplier for stronger moves
       public double ATRMultiplier { get; set; }

       [Parameter("Symbol to Trade", DefaultValue = "XAUUSD")]
       public string TradeSymbol { get; set; }

       [Parameter("Use Moving Average Filter", DefaultValue = true)]
       public bool UseMovingAverage { get; set; }

       [Parameter("Moving Average Period", DefaultValue = 50)]
       public int MaPeriod { get; set; }

       private double asianHigh, asianLow;
       private bool rangeSet = false;
       private AverageTrueRange atr;
       private MovingAverage movingAverage;
       private bool rangeBroken = false;

       // Define session times (Eastern Time)
       private readonly TimeSpan asianSessionStart = new TimeSpan(18, 0, 0); // 6 PM ET
       private readonly TimeSpan asianSessionEnd = new TimeSpan(4, 0, 0); // 4 AM ET
       private readonly TimeSpan londonSessionStart = new TimeSpan(3, 0, 0); // 3 AM ET
       private readonly TimeSpan newYorkSessionEnd = new TimeSpan(16, 0, 0); // 4 PM ET

       protected override void OnStart()
       {
           Print("Enhanced Range Breakout Bot Started");

           // Ensure we are operating on the correct instrument
           if (SymbolName != TradeSymbol)
           {
               Print("This bot is configured to trade " + TradeSymbol + ". Please switch to the correct chart.");
               Stop();
           }

           atr = Indicators.AverageTrueRange(14, MovingAverageType.Simple); // ATR for volatility filtering

           // Moving Average for trend filtering
           if (UseMovingAverage)
           {
               movingAverage = Indicators.MovingAverage(MarketSeries.Close, MaPeriod, MovingAverageType.Simple);
           }

           // Draw Raftman Capital watermark on chart
           Chart.DrawText("RaftmanCapital", "Raftman Capital © 2024", StaticPosition.TopCenter, Colors.DarkGray, 24);
       }

       protected override void OnBar()
       {
           var currentTime = Server.Time.ToLocalTime().TimeOfDay;

           // Step 1: Identify Range During Asian Session
           if (currentTime >= asianSessionStart || currentTime <= asianSessionEnd)
           {
               if (!rangeSet)
               {
                   asianHigh = MarketSeries.High.LastValue;
                   asianLow = MarketSeries.Low.LastValue;
                   rangeSet = true;
                   rangeBroken = false;
                   Print("Setting range: Asian High = " + asianHigh + ", Asian Low = " + asianLow);
               }
               else
               {
                   asianHigh = Math.Max(asianHigh, MarketSeries.High.LastValue);
                   asianLow = Math.Min(asianLow, MarketSeries.Low.LastValue);
               }
           }

           // Step 2: Look for Breakouts During London and New York Session
           if (currentTime > asianSessionEnd && currentTime < newYorkSessionEnd)
           {
               double atrValue = atr.Result.LastValue;
               double range = asianHigh - asianLow;

               // Check for valid volatility (Range must be greater than ATR * Multiplier)
               if (range >= atrValue * ATRMultiplier)
               {
                   Print("Range detected: " + range + " ATR = " + atrValue);

                   // Additional Moving Average filter to confirm trend direction
                   if (UseMovingAverage)
                   {
                       bool isBullish = MarketSeries.Close.LastValue > movingAverage.Result.LastValue;

                       // Breakout: Buy if price breaks above the range and trend is bullish
                       if (!rangeBroken && MarketSeries.Close.LastValue > asianHigh && isBullish)
                       {
                           Print("Breakout detected! Going long.");
                           OpenPosition(TradeType.Buy);
                           rangeBroken = true;
                       }
                       // Breakout: Sell if price breaks below the range and trend is bearish
                       else if (!rangeBroken && MarketSeries.Close.LastValue < asianLow && !isBullish)
                       {
                           Print("Breakout detected! Going short.");
                           OpenPosition(TradeType.Sell);
                           rangeBroken = true;
                       }
                   }
                   else // No moving average filter
                   {
                       // Breakout: Buy if price breaks above the range
                       if (!rangeBroken && MarketSeries.Close.LastValue > asianHigh)
                       {
                           Print("Breakout detected! Going long.");
                           OpenPosition(TradeType.Buy);
                           rangeBroken = true;
                       }
                       // Breakout: Sell if price breaks below the range
                       else if (!rangeBroken && MarketSeries.Close.LastValue < asianLow)
                       {
                           Print("Breakout detected! Going short.");
                           OpenPosition(TradeType.Sell);
                           rangeBroken = true;
                       }
                   }
               }
               else
               {
                   Print("No trades: Volatility too low. Range: " + range + ", ATR Multiplier: " + atrValue * ATRMultiplier);
               }
           }

           // Step 3: Close All Positions at the End of New York Session
           if (currentTime >= newYorkSessionEnd)
           {
               CloseAllPositions();
               rangeSet = false; // Reset range for the next day
               Print("New York session ended. Positions closed, range reset.");
           }
       }

       private void OpenPosition(TradeType tradeType)
       {
           var positionSize = CalculatePositionSize();
           var stopLossInPips = StopLossPips;
           var takeProfitInPips = TakeProfitPips;

           var result = ExecuteMarketOrder(tradeType, SymbolName, positionSize, "RangeBreakout", stopLossInPips, takeProfitInPips);

           if (UseTrailingStop && result.IsSuccessful)
           {
               SetTrailingStop(result.Position);
           }
       }

       private double CalculatePositionSize()
       {
           // Risk calculation based on Stop Loss and Account Balance
           double accountRisk = Account.Balance * RiskPercentage / 100;
           double pipValue = Symbol.PipValue;
           double positionSize = accountRisk / (StopLossPips * pipValue);

           Print($"Position Size: {positionSize}");
           return Symbol.NormalizeVolume(positionSize, RoundingMode.ToNearest);
       }

       private void SetTrailingStop(Position position)
       {
           if (position.TradeType == TradeType.Buy)
           {
               double trailingStop = position.EntryPrice - TrailingStopPips * Symbol.PipSize;
               ModifyPosition(position, trailingStop, position.TakeProfit);
           }
           else if (position.TradeType == TradeType.Sell)
           {
               double trailingStop = position.EntryPrice + TrailingStopPips * Symbol.PipSize;
               ModifyPosition(position, trailingStop, position.TakeProfit);
           }
       }

       private void CloseAllPositions()
       {
           foreach (var position in Positions)
           {
               if (position.SymbolName == SymbolName)
               {
                   ClosePosition(position);
               }
           }
       }

       protected override void OnTick()
       {
           if (UseTrailingStop)
           {
               foreach (var position in Positions)
               {
                   if (position.SymbolName == SymbolName)
                   {
                       AdjustTrailingStop(position);
                   }
               }
           }
       }

       private void AdjustTrailingStop(Position position)
       {
           if (position.TradeType == TradeType.Buy)
           {
               double newStopLoss = MarketSeries.Close.LastValue - TrailingStopPips * Symbol.PipSize;
               if (newStopLoss > position.StopLoss)
               {
                   ModifyPosition(position, newStopLoss, position.TakeProfit);
               }
           }
           else if (position.TradeType == TradeType.Sell)
           {
               double newStopLoss = MarketSeries.Close.LastValue + TrailingStopPips * Symbol.PipSize;
               if (newStopLoss < position.StopLoss)
               {
                   ModifyPosition(position, newStopLoss, position.TakeProfit);
               }
           }
       }
   }
}
 

 

Hi there,

Please create a separate thread for your issue.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
26 Sep 2024, 05:18

Hi there,

This is by design. OnStop() is not called for cBots running on the cloud.

Best regards,

Panagiotis


@PanagiotisCharalampous