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

PanagiotisCharalampous
15 Nov 2024, 14:26

RE: RE: when adding to a losing/winning trade, it changes the take profit

walt50050 said: 

PanagiotisCharalampous said: 

Hi there,

Unfortunately I did not understand your problem. Can you please explain it using screenshots?

Best regards,

Panagiotis

 

100 leverage

1% of account, take profit 1%

the price drops, I re enter with 1% of account, take profit 1%

however now the price need to reach 2% to give me back 1%

why is Ctrader doing this? maybe because the drawdown was too high?

 

 

Unfortunately I cannot help you if you do not provide the information I am asking for


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 10:46

RE: RE: RE: RE: Trading for this account is disabled. Trading for this symbol is currently disabled.

sumarasarjil said: 

sumarasarjil said: 

PanagiotisCharalampous said: 

sumarasarjil said: 

 I am showing disabled symbols on my desktop and I am not able to place any trade, is there any solution for this, please help me fast.

Please talk to your broker

 

 

Hi there, 

Your responses are empty

Best regards,


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 10:45

RE: RE: MA TYPE PARAMETERS IN THE CLOUD

GauchoHood said: 

PanagiotisCharalampous said: 

No clues unfortunately. Can you record a video demonstrating the whole UI and the entire process of adding an instance and reproducing the issue? Maybe it can provide some information we are missing

Hi Panagiotis, hope you are well. Look. I need help to code an increase with the lotsize while my position progresses. For example, when 2 pips positive, double the lot. But the Chatgpt is saying it is not possible to increase Lotsize in Ctrader. Although, we have a button on Ctrader that do Just that, Double the.position size. 

Can you help me please

 

Hi there,

Please create a separate thread with your question and make it more specific. Tell me what information is missing and what is stopping you from implementing this yourself so that I can help you.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 06:56

RE: RE: Make Ctrader able to trade futures

iNeurons said: 

PanagiotisCharalampous said: 

Hi there,

You can trade futures with cTrader as long as your broker offers them.

Best regards,

Panagiotis

I have yet to find any brokers that offer futures on cTrader. Could you please let us know which brokers provide this service?

Unfortunately I cannot advertise brokers. You would need to contact them yourself


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 06:53

Hi there,

Unfortunately I did not understand your problem. Can you please explain it using screenshots?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 06:51

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

martins said: 

PanagiotisCharalampous said: 

Hi there,

The entry price of the position is the average entry price of the deals composing the position. If the position has only one opening deal, then the opening price should not change. If more opening deals are involved e.g. you have increased the size of the position after entering it, the entry price might change as partial volume is closed and deals removed from the position.

Best regards,

Panagiotis

Ok, thanks, that's helpful. I can see from logging that when the volume of a position is INCREASED the calculation of its new Position.Pips value is exactly:
 (oldPips * oldVol - spreadAsPips * increaseInVol) / newVol
which is correctly distributing the pips on the old portion plus the immediate pip loss of the new portion (due to spread) across the new larger volume (and so the EntryPrice will be that many pips from the current price and represent the weighted average). Rounding of the calculation seems usually to the nearest 0.1 pip but sometimes goes the other way, possibly to correct for accumulated rounding error. That's all fine.

HOWEVER, I'm seeing the remaining portion of a position after a REDUCTION in volume ALSO has its Position.Pips altered. Why is that?
Possibly the position was not combined really (in the live server or backtest memory) but rather kept as a collection of parts from each modification that increased volume, so that when it is later reduced some specific part is closed, in a LIFO or FIFO order or some other rule? Is this broker driven? 

So maybe ModifyPosition does not really modify a position in the sense of ending up with one homogeneous position with a single EntryPrice & Pips profit? Can't brokers running cTrader handle merging modification deals into one net holding?

If not, please could the doc say so, and how do we know what the separate parts are so we can predict partial closing results (without laboriously keeping track of all modifications)? Is there any information in a Position that can tell a cBot the position's stats will not react in a predictable way if later PARTIALLY closed ('predictable' meaning Entry & Pips stay unchanged, profit prorata etc)? 

I'm coming to the conclusion it's not good to mix increasing and decreasing volume via ModifyPosition; one or the other yes, predictable, but not both in the same cBot if it's basing decisions on Position.Pips or Account.UnrealizedProfit, or on almost anything other than Equity.

Thanks.

 

Update re "laboriously keeping track": not that hard, but involves keeping ‘account state’ data outside the cTrader account, like in a local file or cloud, not self-contained in the positions - unless perhaps cTrader could add a large Account.Comment field that could store arbitrary data, or make the Positions.Comment modifyable & bigger?? :) 


modifyDeals.Count=95 i=58 modifyDeals[i].Id=6 modifyDeals[i].Vol=19000 modifyDeals[i].Bid=1.36653 modifyDeals[i].Ask=1.36656
modifyDeals.Count=95 i=59 modifyDeals[i].Id=6 modifyDeals[i].Vol=13000 modifyDeals[i].Bid=1.36404 modifyDeals[i].Ask=1.36407
modifyDeals.Count=95 i=60 modifyDeals[i].Id=5 modifyDeals[i].Vol=4000 modifyDeals[i].Bid=1.36399 modifyDeals[i].Ask=1.36402
modifyDeals.Count=95 i=61 modifyDeals[i].Id=6 modifyDeals[i].Vol=-230000 modifyDeals[i].Bid=1.3605 modifyDeals[i].Ask=1.36053
modifyDeals.Count=95 i=62 modifyDeals[i].Id=5 modifyDeals[i].Vol=-230000 modifyDeals[i].Bid=1.3605 modifyDeals[i].Ask=1.36053
modifyDeals.Count=95 i=63 modifyDeals[i].Id=6 modifyDeals[i].Vol=-77000 modifyDeals[i].Bid=1.36007 modifyDeals[i].Ask=1.3601
modifyDeals.Count=95 i=64 modifyDeals[i].Id=5 modifyDeals[i].Vol=-77000 modifyDeals[i].Bid=1.36007 modifyDeals[i].Ask=1.3601
modifyDeals.Count=95 i=65 modifyDeals[i].Id=6 modifyDeals[i].Vol=10000 modifyDeals[i].Bid=1.35909 modifyDeals[i].Ask=1.35912
modifyDeals.Count=95 i=66 modifyDeals[i].Id=5 modifyDeals[i].Vol=19000 modifyDeals[i].Bid=1.36651 modifyDeals[i].Ask=1.36654
modifyDeals.Count=95 i=67 modifyDeals[i].Id=5 modifyDeals[i].Vol=10000 modifyDeals[i].Bid=1.36892 modifyDeals[i].Ask=1.36895
modifyDeals.Count=95 i=68 modifyDeals[i].Id=5 modifyDeals[i].Vol=13000 modifyDeals[i].Bid=1.37044 modifyDeals[i].Ask=1.37047

  struct modifyDeal {     // https://stackoverflow.com/questions/33809867/c-sharp-struct-in-a-list
  public int Id { get; set; }
  public double Vol { get; set; }
  public double Bid { get; set; }
  public double Ask { get; set; }
  public modifyDeal(int id, double vol, double bid, double ask)
  { Id = id; Vol = vol; Bid = bid; Ask = ask; }
 }

 List<modifyDeal> modifyDeals = new List<modifyDeal>(); // 14nov24

    var deal = new modifyDeal(position.Id, newVolume - position.VolumeInUnits, Symbol.Bid, Symbol.Ask);
   //or deal.Id = position.Id; etc
   modifyDeals.Add(deal); 

Might be able to extract same info using the History interface possibly (how far back does it go?), but haven't found all the doc about it, for instance where is History.OrderByDescending() other than in the example https://help.ctrader.com/ctrader-algo/references/Trading/History/History/#examples 

Later: Actually only one adjustment number per position might need remembering in order to emulate proportional netting when partially closing a position that has been increased earlier - the difference between ‘the proportional Pips or Entry expected before the partial close is done’ and ‘the actual new Pips or new Entry that appears in the Position afterwards’ - so the Bot can apply that offset to later Pips & profit (with opposite adjustment to Balance).
Is there any way of storing a small amount of data per position on the server, for instance a modifyable Comment? 
 

Hi there,

HOWEVER, I'm seeing the remaining portion of a position after a REDUCTION in volume ALSO has its Position.Pips altered. Why is that?
Possibly the position was not combined really (in the live server or backtest memory) but rather kept as a collection of parts from each modification that increased volume, so that when it is later reduced some specific part is closed, in a LIFO or FIFO order or some other rule? Is this broker driven? 

This is what I explained in my previous post. Positions are just collections of deals traded in a FIFO manner.

Is there any information in a Position that can tell a cBot the position's stats will not react in a predictable way if later PARTIALLY closed ('predictable' meaning Entry & Pips stay unchanged, profit prorata etc)? 

There isn't. As you correctly pointed out, if you need this information, you need to track it your self. 

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 06:45

Hi there,

Try using multiple profiles

https://help.ctrader.com/ctrader/interface/settings/?h=profiles#startup

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
15 Nov 2024, 06:41

RE: RE: Risk-Reward - Market order lots not computer properly ?

all-raceway0m said: 

PanagiotisCharalampous said: 

Hi there,

I did not understand what you are doing and what exactly is happening. Can you record a video so that we can understand what you are looking at?

Best regards,

Panagiotis

Hi,

I undwerstood from this video that I can fix a risk reward (lets sasy 100 usd) and when I move My SL on a limit order the nb of lots is computed automatically to keep 100 usd of risk.
And that if I change to market order the nb of lots will be computer when I click the buy/sell button based on the current price to respect 100 usd risk.

https://help.ctrader.com/ctrader-web/charts/risk-reward/

On video below that I did we can see:

  • when I chose limit order and fix the risk to 100 usd. nb of lots is computed automatically when i change the entry point
  • when I change to market order and place the order the nb od lots is not recomputed but the last computed for the entry poitn which his not righ

https://share.icloud.com/photos/0adBeJVHTTMum0RYU3eeekHmQ

My be I understood wrong the feature for market order.., if i understood wrong can you any idea how I can do this as I want to always have the same risk

Thanks

Hi there,

It is impossible to set the risked amount exactly at a fixed stop loss price, since the trade eventually needs to be rounded at a volume that meets the minimum step set by the broker. Therefore you will get an approximation at best. The tool calculates the exact volume that needs to be traded for that amount to be risked but eventually you need to trade the closest valid volume.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
14 Nov 2024, 14:23

RE: RE: The ability To Copy And Paste Build Errors & Results for code debugging. (Mind Numbingly Infuriating)

Enivid said: 

PanagiotisCharalampous said: 

Hi all,

Just use an external IDE for development. You can do this with a click of a button and get all the development functionalities you need. The built in editor is appropriate only for simple projects.

Best regards,

Panagiotis

 

Even with simple projects, one often needs to copy the error messages. Moreover, the new developers and advanced users who are learning to code are likely doing that in cAlgo and they are those who are most likely to encounter compilation errors they need to copy (to ask other developers about).

They can do that in an IDE. The product team will not divert resources from other important features to build something that already exists and can be used immediately.


@PanagiotisCharalampous

PanagiotisCharalampous
14 Nov 2024, 09:31

Hi all,

Just use an external IDE for development. You can do this with a click of a button and get all the development functionalities you need. The built in editor is appropriate only for simple projects.

Best regards,

Panagiotis

 


@PanagiotisCharalampous

PanagiotisCharalampous
14 Nov 2024, 07:02

RE: RE: Impossible to save charts models

f3nryll said: 

PanagiotisCharalampous said: 

Hi there,

Can you record a video demonstrating what exactly is happening?

Best regards,

Panagiotis

https://drive.google.com/file/d/14eP04mOEHZhxJ0Shv4MKpJvKFv3rxAt1/view?usp=drive_link

Hi there,

Thank you. The product team will investigate this issue and resolve it in an upcoming update.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
14 Nov 2024, 06:48

Hi there,

The entry price of the position is the average entry price of the deals composing the position. If the position has only one opening deal, then the opening price should not change. If more opening deals are involved e.g. you have increased the size of the position after entering it, the entry price might change as partial volume is closed and deals removed from the position.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
14 Nov 2024, 06:41

Hi there,

I don't think you can install cMAM on Linux.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 12:23

RE: RE: cBot that references several Renko periods

ene.andrei.plc said: 

PanagiotisCharalampous said: 

Hi mariusgunnerud,

It is on the roadmap but we do not have at ETA at the moment.

Best Regards,

Panagiotis

Hi Panos,

Apologies if this is available elsewhere, but has this been added to cTrader? Having issues finding it in the KB.

Regards,

Andrei

Hi Andrei,

Yes, renko charts are available in backtesting 

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 12:21

RE: RE: RE: Error | CBot instance crashed with error #ED2F94F3.

samyelzallat said: 

PanagiotisCharalampous said: 

samyelzallat said: 

when I remove onbarclosed from the bot and use onbar it doesn't cause an error

Hi there,

Please provide the complete cBot code

Best regards,

Panagiotis

using cAlgo.API;using cAlgo.API.Collections;using cAlgo.API.Indicators;using cAlgo.API.Internals;using cAlgo.Indicators;using Microsoft.VisualBasic;using System;using System.Collections.Generic;using System.ComponentModel;using System.Linq;namespace cAlgo.Robots {    [Robot(AccessRights = AccessRights.None, AddIndicators = true)] public class WaveRider: Robot {        [Parameter("Trade Volume (in units)", DefaultValue = 2000, MinValue = 2000, Step = 2000)] public double TradeVolume {          get;          set;        } [Parameter("Partial Take Profit (in units)", DefaultValue = 1000, MinValue = 1000, Step = 1000)] public double VolumeToClose {          get;          set;        } [Parameter("ATR Period", Group = "ATR", DefaultValue = 20)] public int AtrPeriod {          get;          set;        } [Parameter("ATR MA Type", Group = "ATR", DefaultValue = MovingAverageType.Simple)] public MovingAverageType AtrMa {          get;          set;        }        private AverageTrueRange atr;        [Parameter("First Source", DefaultValue = "Open", Group = "Moving Averages")] public DataSeries OpenSmaSource {          get;          set;        } [Parameter("Second Source", DefaultValue = "Close", Group = "Moving Averages")] public DataSeries CloseSmaSource {          get;          set;        } [Parameter("SMA Period", Group = "Moving Averages", DefaultValue = 20)] public int SmaPeriod {          get;          set;        } [Parameter("SMA Period", Group = "Moving Averages", DefaultValue = 100)] public int Sma2Period {          get;          set;        }        private SimpleMovingAverage OpenSma;        private SimpleMovingAverage CloseSma;        private SimpleMovingAverage BiggerSma;        private        const string myComment = "Trendat";        private bool FirstTradeActive = false;        private bool IsItLong = false;        private bool IsItShort = false;        private bool ModifiedOnce = false;        private bool ModifiedTwice = false;        private bool MultipleTrades = false;        private bool GridStopped = false;        private bool StepOne = false;        private bool StepTwo = false;        private bool GridStopLossSet = false;        private double MultiplierReference = 0;        private double GlobalAtrThreshold;        private double GlobalFirstEntry;        private double GlobalExitProfit;        private double GlobalExitMeasure;        private double GlobalGrid;        private double GridSl;        double GridModifiedSL;        private double LotsTraded = 0;        protected override void OnStart() {          atr = Indicators.AverageTrueRange(AtrPeriod, AtrMa);          OpenSma = Indicators.SimpleMovingAverage(OpenSmaSource, SmaPeriod);          CloseSma = Indicators.SimpleMovingAverage(CloseSmaSource, SmaPeriod);          BiggerSma = Indicators.SimpleMovingAverage(CloseSmaSource, Sma2Period);        }        protected override void OnBarClosed() {          double closingPrice = Bars.ClosePrices.Last(1);          double openingPrice = Bars.OpenPrices.Last(1);          double closingPrice2ago = Bars.ClosePrices.Last(2);          double openingPrice2ago = Bars.OpenPrices.Last(2);          double closingPrice3ago = Bars.ClosePrices.Last(3);          double openingPrice3ago = Bars.OpenPrices.Last(3);          double closingPrice4ago = Bars.ClosePrices.Last(4);          double openingPrice4ago = Bars.OpenPrices.Last(4);          double closingPrice5ago = Bars.ClosePrices.Last(5);          double openingPrice5ago = Bars.OpenPrices.Last(5);          double closingPrice6ago = Bars.ClosePrices.Last(6);          double openingPrice6ago = Bars.OpenPrices.Last(6);          double closingPrice7ago = Bars.ClosePrices.Last(7);          double openingPrice7ago = Bars.OpenPrices.Last(7);          double closingPrice8ago = Bars.ClosePrices.Last(8);          double openingPrice8ago = Bars.OpenPrices.Last(8);          double closingPrice9ago = Bars.ClosePrices.Last(9);          double openingPrice9ago = Bars.OpenPrices.Last(9);          double closingPrice10ago = Bars.ClosePrices.Last(10);          double openingPrice10ago = Bars.OpenPrices.Last(10);          double OpenSmaLast = OpenSma.Result.Last(1);          double OpenSma3Ago = OpenSma.Result.Last(3);          double CloseSmaLast = CloseSma.Result.Last(1);          double CloseSma3Ago = CloseSma.Result.Last(3);          double BiggerSmaLast = BiggerSma.Result.Last(1);          bool BuySignal = CloseSmaLast > OpenSmaLast && OpenSmaLast > BiggerSmaLast && openingPrice3ago < OpenSma3Ago && closingPrice3ago > CloseSma3Ago && closingPrice2ago > openingPrice2ago && closingPrice > openingPrice;          bool SellSignal = CloseSmaLast < OpenSmaLast && CloseSmaLast < BiggerSmaLast && openingPrice3ago > OpenSma3Ago && closingPrice3ago < CloseSma3Ago && closingPrice2ago < openingPrice2ago && closingPrice < openingPrice;          double GridRange = Math.Abs(closingPrice2ago - openingPrice8ago);          double DistanceFromEntry = Math.Abs(GlobalFirstEntry - closingPrice);          int DistanceMultipled = 0;          if (GlobalGrid != 0) {            DistanceMultipled = (int) Math.Floor(DistanceFromEntry / GlobalGrid);          }          double SpreadAtr = Math.Round(atr.Result.Last(1) / Symbol.PipSize, 4);          double StopLossAtr = Math.Round(GridRange / Symbol.PipSize, 4) * 4;          double spread = Symbol.Spread / Symbol.PipSize;          double MultipleTradesMeasure = atr.Result.Last(1);          double MultipleTradesAtr = Math.Round((atr.Result.Last(1)) / Symbol.PipSize, 4);          GlobalExitProfit = MultipleTradesAtr;          GlobalExitMeasure = MultipleTradesMeasure;          var HourlyTf = MarketData.GetBars(TimeFrame.Hour);          double HrlyOpening = HourlyTf.OpenPrices.Last(0);          double HrlyHigh = HourlyTf.HighPrices.Last(0);          double HrlyLow = HourlyTf.LowPrices.Last(0);          double HrlyOpening2Ago = HourlyTf.OpenPrices.Last(1);          double HrlyClosing2Ago = HourlyTf.ClosePrices.Last(1);          double HrlyHigh2Ago = HourlyTf.HighPrices.Last(1);          double HrlyLow2Ago = HourlyTf.LowPrices.Last(1);          double HrlyOpening3Ago = HourlyTf.OpenPrices.Last(2);          double HrlyClosing3Ago = HourlyTf.ClosePrices.Last(2);          double HrlyCandleBody = Math.Abs(HrlyOpening2Ago - HrlyClosing2Ago);          double HrlyUpperWick;          double HrlyLowerWick;          bool PossibleReverse = false;          if (HrlyClosing2Ago > HrlyOpening2Ago) {            HrlyUpperWick = HrlyHigh2Ago - HrlyClosing2Ago;            HrlyLowerWick = HrlyOpening2Ago - HrlyLow2Ago;            if (HrlyUpperWick >= 0.4 * HrlyCandleBody) {              PossibleReverse = true;            }          } else if (HrlyClosing2Ago < HrlyOpening2Ago) {            HrlyUpperWick = HrlyHigh2Ago - HrlyOpening2Ago;            HrlyLowerWick = HrlyClosing2Ago - HrlyLow2Ago;            if (HrlyLowerWick >= 0.4 * HrlyCandleBody) {              PossibleReverse = true;            }          }          bool BullishHr = HrlyClosing2Ago > HrlyOpening2Ago && HrlyClosing3Ago > HrlyOpening3Ago;          bool BearishHr = HrlyClosing2Ago < HrlyOpening2Ago && HrlyClosing3Ago < HrlyOpening3Ago;          if (DistanceMultipled > MultiplierReference && !ModifiedOnce && !GridStopped && (IsItLong || IsItShort)) {            MultiplierReference = DistanceMultipled;            MultipleTrades = true;            TradeType tradeType = IsItLong ? TradeType.Buy : TradeType.Sell;            ExecuteMarketOrder(tradeType, SymbolName, TradeVolume, MultiplierReference.ToString(), GridSl, null, myComment);            LotsTraded += 0.01;          }          if (FirstTradeActive) {            return;          }          if (BuySignal && spread <= .9 && spread < SpreadAtr) {            ExecuteMarketOrder(TradeType.Buy, SymbolName, TradeVolume, "First Buy", StopLossAtr, null, myComment);            IsItLong = true;            FirstTradeActive = true;            GlobalFirstEntry = Symbol.Ask;            GlobalAtrThreshold = atr.Result.Last(1);            GlobalGrid = GridRange;            GridSl = StopLossAtr;            LotsTraded += 0.01;          } else if (SellSignal && spread <= .9 && spread < SpreadAtr) {            ExecuteMarketOrder(TradeType.Sell, SymbolName, TradeVolume, "First Sell", StopLossAtr, null, myComment);            IsItShort = true;            FirstTradeActive = true;            GlobalFirstEntry = Symbol.Bid;            GlobalAtrThreshold = atr.Result.Last(1);            GlobalGrid = GridRange;            GridSl = StopLossAtr;            LotsTraded += 0.01;          }        }

this will crash until you replace OnBarClosed with OnBar, which I did to have it work
also works with 1hr tf correctly, and it crashes with both fp markets and fusion markets accounts

Thank you. This issue will be fixed in an upcoming update.


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 10:41

RE: FontFamily in Button Text?

ctid5996231 said: 

@Panagiotis?

Hi there,

It looks like a bug. The team will investigate and resolve in an upcoming update.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 07:42

RE: RE: RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader

kaxalope said: 

PanagiotisCharalampous said: 

serge.owonaokoa said: 

PanagiotisCharalampous said: 

serge.owonaokoa said: 

PanagiotisCharalampous said: 

kaxalope said: 

PanagiotisCharalampous said: 

Hi there,

Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.

Best regards,

Panagiotis

I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.

No it is not possible, however you can reference shared projects across many solutions, if this is what you are looking for.

Best regards,

Hi  PanagiotisCharalampous,

I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.

I decide to follow you recommendation of using a Shared Project. I have a couple questions:

1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?

2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?

I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?

 

Thanks.

Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.

 

Hi there,

Unfortunately there is no correct answer to your questions as it all depends on your own requirements.

Best regards,

Panagiotis

Thank you for your very diplomatic reply, that doesn't really take us anywhere.

I think it's really deciving to point your users nowhere rather than helping with real problems.

If what cTrader recommend is to write duplicate code, then please be clear on that.

If you recommend shared project then please be clear and give a simple example of :

Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.

If that's not possible then please say so.

I really don't see what our own requirements could make a difference in this very specific question.

 

 

Hi there,

It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit. 

What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.

Best regards,

Panagiotis

No, a cTrader bot/plugin/indicator is not a project but a solution. This is the reason for the topic.

I don't see the problem. In .Net, you can reference projects that are parts of solutions in other solutions. This is not a cTrader thing, is a .Net thing. So you can have an indicator as a standalone solution, as well as reference it in other solutions i.e cBots or plugins


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 07:12

RE: RE: RE: RE: RE: RE: Proposal: Improved Project Structure for cBots Development in cTrader

serge.owonaokoa said: 

PanagiotisCharalampous said: 

serge.owonaokoa said: 

PanagiotisCharalampous said: 

kaxalope said: 

PanagiotisCharalampous said: 

Hi there,

Why don't you use an external IDE like Visual Studio instead? I don't think the team will invest time in reinventing the wheel.

Best regards,

Panagiotis

I do it, and although it improves things like IntelliSense, the management of duplicated code between bots doesn't get better since each bot is a solution, as I mentioned in the previous post. If there were a way to make each bot a project instead of a solution, then the development experience could be greatly improved. And if there is a way, I'm not aware of it.

No it is not possible, however you can reference shared projects across many solutions, if this is what you are looking for.

Best regards,

Hi  PanagiotisCharalampous,

I'm trying to create a shared Library to use across my indicators and cBots, I can't stand replicating or copying code.

I decide to follow you recommendation of using a Shared Project. I have a couple questions:

1- Do you recommend having a single Git Repo for all Indicators and cBots, I mean creating the repo under <USER_HOME>\Documents\cAlgo\Sources or Should I setup 1 project per indicator?

2-If 3 indicator are all using the same shared Project, Do I need to create that sharedProject with the Solution of 1 Indicator or cBot and reuse in others?

I noticed that if the SharedProject isn't located within a specific location the AlgoHost.exe proecess crashes with error of not having access to the SharedProject folder. Which folder under under <USER_HOME>\Documents\cAlgo\Sources the SharedProject must be to prevent this?

 

Thanks.

Would be great i you could provide a sample of 2 indcators and 2 cBots using a shared project.

 

Hi there,

Unfortunately there is no correct answer to your questions as it all depends on your own requirements.

Best regards,

Panagiotis

Thank you for your very diplomatic reply, that doesn't really take us anywhere.

I think it's really deciving to point your users nowhere rather than helping with real problems.

If what cTrader recommend is to write duplicate code, then please be clear on that.

If you recommend shared project then please be clear and give a simple example of :

Indicator A, Indicator B, sharedProject C and robot D all using logic in SharedProject C.

If that's not possible then please say so.

I really don't see what our own requirements could make a difference in this very specific question.

 

 

Hi there,

It's not a diplomatic answer, it's just beyond the scope of my work. My role here is to explain how cTrader works, answer questions specific to cTrader and liaise for the resolution of problems. Giving trading advises, answering general software development questions and teaching people to code is above my role. Therefore I rarely engage in such discussions. The question on how to organize your projects is not a cTrader specific one but a general software development question. A cBot/Indicator/Plugin is just a .Net project so whatever applies to other .Net projects, applies here as well. Each developer organizes his projects as he sees fit. 

What you describe should be possible, unfortunately I do not have time to prepare an example for you. If you thing there is a specific cTrader problem, let us know how to reproduce it and we will have a look at this.

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 06:38

Hi there,

Can you record a video demonstrating what exactly is happening?

Best regards,

Panagiotis


@PanagiotisCharalampous

PanagiotisCharalampous
13 Nov 2024, 06:35

RE: RE: RE: RE: Custom indicator Plotting horizontal lines at User specified price increments

SaphirSpecs said: 

PanagiotisCharalampous said: 

SaphirSpecs said: 

PanagiotisCharalampous said: 

 

so I’m not really fam with coding on this platform and currently the code does plot horizontal lines on the workspace. 
the ideal output is 

-user defines (current) price at which the algo starts plotting horizontal lines

-user defines increment at which each horizontal line is plotted 

 for example ( Gold 2000, 3, 100) 

algo plots a horizontal line each $3 

currently my code gives me the prompts for each parameter but does not even plot a single line. 
ideally the code would plot automatically using a for loop. But worst case scenario I can manually enter the code for each line 

Hi there,

Can you explain your issue in more detail? What do you expect your code to do and what does it do instead?

Best regards,

Panagiotis

 

Hi there,

I tried your indicator and it plots the lines fine. 

So I do not see a problem.

Best regards,

Hey there,

 

Thanks for trying out the code. However the issue is that it's not supposed to just plot one line. It supposed to plot multiple lines as defined by the User. Could you share the code you used to get it to plot a line ? Cause I was not able able able to get my code to plot a single line. 

 

Thank you in advance.

 

Hi there,

I used the code you shared. If you want to plot several lines, you need to write the relevant code i.e. a for loop where you will plot lines at different increments.

Best regards,

Panagiotis


@PanagiotisCharalampous