Replies

PanagiotisCharalampous
23 Sep 2020, 14:13

Hi Mark,

Is it possible in cTrader Automate to programmatically populate a data structure with the values that would make up a 1 hour candle constructed from mid prices, i.e. open mid, high mid, low mid and close mid?

Yes this is possible

Is GetTicks() the way to do this, i.e. get all the ticks from e.g. 10:00 am and 0 seconds to 10:59 and 59 seconds, then convert the ticks to mid price using the ask and the bid and then select the open, high, low and close from the mid price ticks to give me 4 values representing a 1 hour candle constructed from mid prices? 

Yes you should use GetTicks() for this. 

Also is GetTicks() able to get every tick in a 1 hour time frame or does it miss ticks, for example in MT4 the on-tick event is triggered by a tick, but if your algo is still processing this tick when the next tick arrives it will miss this next tick.

This is how it works in cTrader as well but this should not affect historical data. Ticks are stored on the server even if your client does not process them.

 Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 13:58

Hi ctid1074959,

as mentioned above, I have a variable called :"absolutehigh" for highest profit point for time period... the "absoluteHIgh" for the shorter time period is higher (25k) vs the onger time period of (17k)... this should NOT be

No, you did not provide this information in the original post. To help you further with this, you need to provide us with the complete cBot code and steps to reproduce this behavior e.g. cBot parameters or any other information we need to know.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 09:24

Hi cumpac21,

Trades are not copied to your main account but in your subaccount, which is accessible only through the cTrader Copy section on cTrader Web. You should go through the documentation before using the service.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 09:07

Hi cumpac21,

Please provide more information about the problem. What is the balance of your subaccount? What is the leverage? Which trades have not been copied?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 08:27

Hi Tan,

It is not possible to access cTrader Web from Android and iOS devices.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 08:26

Hi Sam,

You can check if Positions.Count == 0 before placing a trade.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 08:24

Hi there,

Why do you expect to see the same results on different dates?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
23 Sep 2020, 08:22

Hi Fxpool,

This section is only for suggestions. Please post your issue in cTrader Copy section. This post will be deleted soon.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 08:43

Hi ctid956028,

Yes but it is hosted in a third party application which we do not control. So we need the information requested above. If you cannot provide it, then the developer can do it.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 08:13

Hi lazar.florinmihai,

Thanks for posting your issue but I am afraid I did not understand what the problem is. If you could describe it in another way or maybe record a video, it would be helpful.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 08:09

Hi Mars24,

Please use the Suggestions section for suggestions.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 08:04 ( Updated at: 21 Dec 2023, 09:22 )

Hi duketv,

If you check your log you will see an exception.

This happens because you have not initialized your Bollinger Bands indicator anywhere. Add this in OnStart()

 BollingerBands = Indicators.BollingerBands(Bars.ClosePrices, BbPeriods, BbStdDev, BbMaType);

On top of that, you are trying to modify a position that does not exist

        protected override void OnBar()
        {
            var bbTop = BollingerBands.Top.LastValue;
            var bbMain = BollingerBands.Main.LastValue;
            var bbBottom = BollingerBands.Bottom.LastValue;

            if (_sma1.Result.LastValue < Symbol.Bid & Macd.MACD.Last(0) > Macd.Signal.Last(0) & Macd.MACD.Last(0) < 0)
                ExecuteMarketOrder(TradeType.Buy, this.SymbolName, Volume, InstanceName, null, null);
            Positions[0].ModifyStopLossPrice(bbBottom);

            if (_sma1.Result.LastValue > Symbol.Bid & Macd.MACD.Last(0) < Macd.Signal.Last(0) & Macd.MACD.Last(0) > 0)
                ExecuteMarketOrder(TradeType.Sell, this.SymbolName, Volume, InstanceName, null, null);
            Positions[0].ModifyStopLossPrice(bbTop);
        }

Try this instead

        protected override void OnBar()
        {
            var bbTop = BollingerBands.Top.LastValue;
            var bbMain = BollingerBands.Main.LastValue;
            var bbBottom = BollingerBands.Bottom.LastValue;

            if (_sma1.Result.LastValue < Symbol.Bid & Macd.MACD.Last(0) > Macd.Signal.Last(0) & Macd.MACD.Last(0) < 0)
            {
                var position = ExecuteMarketOrder(TradeType.Buy, this.SymbolName, Volume, InstanceName, null, null).Position;
                position.ModifyStopLossPrice(bbBottom);
            }

            if (_sma1.Result.LastValue > Symbol.Bid & Macd.MACD.Last(0) < Macd.Signal.Last(0) & Macd.MACD.Last(0) > 0)
            {
                var position = ExecuteMarketOrder(TradeType.Sell, this.SymbolName, Volume, InstanceName, null, null).Position;
                position.ModifyStopLossPrice(bbTop);
            }
        }

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 07:51

Hi koktos632,

Yes, there is a possibility that Bars.Count will change while the cBot is running e.g. due to a reconnection and a refresh of the chart.

Best Regards,

Panagiotis 

Join us on Telegram

 


@PanagiotisCharalampous

PanagiotisCharalampous
22 Sep 2020, 07:46

Hi cosacdaher,

I am also confused since the screenshot you sent does not provide any evidence of something going wrong. You don't even remember where the equity stop loss was set so I am not sure what am I supposed to check.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 14:58

Hi ctid956028,

Did you contact the application developer?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 14:30

Hi ctid956028,

Can you please explain to us what is this application? Which browser and version do you use? How can we reproduce this problem?

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 10:01

Hi alexnikon,

I had a look at the cBot and the indicator and I do not see anything wrong. But from what I understand you are comparing irrelevant information. You are opening trades in the middle of the daily bar based on the current state of the daily moving average but you compare the conditions with the indicator calculated using the finalized daily bar. This is wrong since the values of the finalized daily bar are different from the value of the indicator at the current moment the order was executed.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 08:53

Hi caglar_G,

Try this instead

Result1[index] >= Result2[index]

Best Regards,

Panagiotis 

Join us on Telegram 

 


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 08:50

Hi reign777,

There is no such option at the moment.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous

PanagiotisCharalampous
21 Sep 2020, 08:46

Hi HumanArsenal,

Symbols are added by brokers, not by Spotware. Talk to your broker.

Best Regards,

Panagiotis 

Join us on Telegram


@PanagiotisCharalampous