Topics
Replies

firemyst
19 Dec 2023, 05:35 ( Updated at: 19 Dec 2023, 06:44 )

Two options:

  1. if you have the code, update the code to accept parameters
  2. does the indicator have a “constructor” you can call? If so, it may have parameters you can initialize through that. 

@firemyst

firemyst
19 Dec 2023, 05:26 ( Updated at: 19 Dec 2023, 06:44 )

Vote for the other threads I listed within the suggestion thread you started if you haven't already:

 

https://ctrader.com/forum/ctrader-support/42539

 


@firemyst

firemyst
16 Dec 2023, 14:51 ( Updated at: 17 Dec 2023, 17:00 )

RE: RE: Backtesting with Pending Orders - Amazing in Backtest, Devastating in Reality - is it my code?

mike.r.alderson said: 

PanagiotisCharalampous said: 

Hi Mike,

It is still hard to help you without exact steps on how to reproduce the issues on our machines. If you want the community to help you with coding issues, you need to help them reproduce the problem in two minutes :) Nobody will spend hours guessing what is wrong. We have our own problems to solve :)

Best regards,

Panagiotis

Ok, I'll try to be more exact:

I don't ‘think’ there's anything wrong with my code (although, happy to be corrected)- it seems to operate (in real-time), as expected.

My Question maybe should be: Does anyone else find that the Backtest doesn't seem to reflect anywhere near the Real-Time performance when testing a cBot that uses Pending Orders (i.e. Backtest performs amazingly, but in real-time shows poor results) and has anyone overcome this problem?  

(Perhaps, a setting I need to change or an add-on I need to download, a certain library I should be using?)

So as @PanagiotisChar hinted in a previous post, how are you doing your back tests? What settings in the back testing mechanism do you use? Do you have any screen captures to show your back test results with your settings?

Like, you're not providing us with any details on how you are backtesting, what the parameter settings are, etc etc.


@firemyst

firemyst
16 Dec 2023, 14:45 ( Updated at: 17 Dec 2023, 17:00 )

RE: RE:

jim.tollan said: 

bjarman16 said:

sorry this is the algo

 

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

namespace cAlgo
{
    [Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.FullAccess)]
    public class SupplyDemandRobot : Robot
    {
        [Parameter("Trade Volume", Group = "Basic Setup", DefaultValue = 10000)]
    public int TradeVolume { get; set; }
    [Parameter("Instance", DefaultValue = "Instance")]
        public string Instance { get; set; }

        private SupplyandDemand supplyAndDemand;

        protected override void OnStart()
        {
            supplyAndDemand = Indicators.GetIndicator<SupplyandDemand>(5, TimeFrame.Hour, "Red", "Lime", 20);
        }

        protected override void OnBar()
{
    // Check if price is in a supply or demand zone
    foreach (var zone in supplyAndDemand.sList)
    {
        // Check if current bar's high price is greater than zone's high price 
        // AND previous bar's high price was lower than zone's high price
        if (Bars.HighPrices.Last(1) > zone.high && Bars.HighPrices.Last(2) <= zone.high)
        {
            // Enter short trade as price entered a supply zone
            ExecuteMarketOrder(TradeType.Sell, Symbol, TradeVolume, Instance, null, null, null, "Supply Zone");
        }
    }

    foreach (var zone in supplyAndDemand.dList)
    {
        // Check if current bar's low price is lower than zone's low price 
        // AND previous bar's low price was higher than zone's low price
        if (Bars.LowPrices.Last(1) < zone.low && Bars.LowPrices.Last(2) >= zone.low)
        {
            // Enter long trade as price entered a demand zone
            ExecuteMarketOrder(TradeType.Buy, Symbol, TradeVolume, Instance, null, null, null, "Demand Zone");
        }
    }
}

    }
}

Hello there  - I actually took a look at this inside visual studio and noticed that the indicator Calculate() method isn't getting fired (when using the Robot - it's actually fine when using purely as an indicator).

I'm using cTrader v4.7.7 - could there be an issue here?? I tried creating a basic indicator from scratch inside cTrader and wiring it up to your Robot also and it also didn't fire the Calculate()  override. I then went back to basics and created a vanilla custom indicator and robot and referenced the indicator from the new robot. same outcome - Calculate() doesn't get fired.

Can anyone else confirm the same outcome?? - oh and hello everyone, been lurking for a long-time due to my username getting blocked for no apparent reason!! However, big thanks to the cTrader community team, now unblocked and ready for, ermmm responding!! ;).

Happy to attach my vanilla code examples that illustrate the issue when using an indicator inside a robot script using v4.7.7.

anyway -cheers and hello from me.

 

Of course it's not being fired - you aren't calling the indicator in a way to force its values to be calculated. You do this directly by calling the Calculate method, or indirectly by calling methods such as “.LastValue" to get the last value of the indicator, “.Last(1)”, “.Last(2)” (to get the value 2 bars ago), etc etc.

Examples (look at examples 2 & 3):

https://help.ctrader.com/ctrader-automate/references/Collections/DataSeries/IndicatorDataSeries/#examples

https://ctrader.com/forum/calgo-support/36512

 

https://help.ctrader.com/ctrader-automate/articles/for-developers/how-to-use-indicators-in-cbots/

https://ctrader.com/forum/cbot-support/37542

 

 

 


@firemyst

firemyst
15 Dec 2023, 07:46 ( Updated at: 15 Dec 2023, 14:58 )

Duplicate:

 

https://ctrader.com/forum/calgo-support/42506

 


@firemyst

firemyst
13 Dec 2023, 06:58 ( Updated at: 21 Dec 2023, 09:23 )

RE: RE: Does anyone at Spotware actually use cTrader? Cannot grab SL/TP lines when multiple indicators on chart without first moving chart. :-/

PanagiotisCharalampous said: 

mikefox7602 said: 

One of the reasons i dont consider this plattform being suited for real trading. 

This is really dangerous. 

Dont like when plattforms are not made customizable. 

Hi there,

You can hide the indicator titles in the Viewing Options

Best regards,

Panagiotis

The overall point of this thread is one can't trade nicely with the indicator tiles shown, because they get in the way that the user cannot “Grab” either the SL or TP lines when trading.

Even if on the chart if the eyeball is clicked or unclicked, a user simply cannot click and drag the SL/TP line. In this example below, the SL bar can't be grabbed and dragged unless someone moves the entire chart area down so graphically the SL and TP lines come down BELOW all the indicator tiles:

One when the chart is re positioned like so:

is one able to grab and move the SL/TP lines.

So in a nutshell, as of version cTrader v 4.8.30 Spotware still hasn't fixed this issue. All they should need to do is fix the indicator tiles shown so their Z-Axis value is lower than the SL/TP lines displayed.

Or as I suggested in my original post, INDENT the indicator tiles displayed so the SL/TP parts can be grabbed.

 

 


@firemyst

firemyst
12 Dec 2023, 23:58 ( Updated at: 21 Dec 2023, 09:23 )

Yes.

 


@firemyst

firemyst
12 Dec 2023, 23:56 ( Updated at: 13 Dec 2023, 06:21 )

If you don't post screen captures or sample code reproducing the issue, how are you expecting people to help you?


@firemyst

firemyst
12 Dec 2023, 23:55 ( Updated at: 13 Dec 2023, 06:21 )

Can you post a screen capture showing the issue?

I don't understand what you mean by “platform tab” because Windows shows running programs in the “Task bar”.


@firemyst

firemyst
12 Dec 2023, 23:53 ( Updated at: 13 Dec 2023, 06:21 )

Can you post a screen capture showing the issue?


@firemyst

firemyst
12 Dec 2023, 23:51 ( Updated at: 13 Dec 2023, 06:21 )

You need to post this in the “Suggestions” forum:

 

https://ctrader.com/forum/suggestions

 


@firemyst

firemyst
11 Dec 2023, 11:27 ( Updated at: 12 Dec 2023, 06:31 )

Duplicate

https://ctrader.com/forum/calgo-support/42431

 


@firemyst

firemyst
11 Dec 2023, 11:25 ( Updated at: 12 Dec 2023, 06:31 )

Yes.

Remove:

[Output("Main", LineColor = "Turquoise")]

 


@firemyst

firemyst
11 Dec 2023, 11:22 ( Updated at: 12 Dec 2023, 06:31 )

Duplicate

https://ctrader.com/forum/indicator-support/42484

 


@firemyst

firemyst
08 Dec 2023, 06:47 ( Updated at: 08 Dec 2023, 13:47 )

RE: algohost.exe "Application Error" and crashing

PanagiotisCharalampous said: 

Hi firemyst,

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
 

I couldn't. cTrader became unresponsive. I had to kill it via task manager and restart. 

However, if you can confirm the information will still be there even after restarting, I can try sending the trouble-shooting information? (I don't want to waste Spotware's time if it'll be pointless since I had to restart)


@firemyst

firemyst
05 Dec 2023, 02:20

Do you have it set as a trailing stop loss? That's the only way it should “walk”. 


@firemyst

firemyst
05 Dec 2023, 01:23

RE: RE: How to stop/pause closing an existing position countinuously if given criteria have already been met once?

JINGXUAN said: 

PanagiotisCharalampous said: 

Hi there,

Unfortunately it is a lot of work to create a comprehensive example. If I find some time later, I will.

Best regards,

Panagiotis

Okay, many thanks in advanced ! PanagiotisCharalampous let me know when there are any example I can refer to, I will pay attention to any update of this link, have a great day ahead!

I keep track of every position I open internally using Dictionary objects:

 private Dictionary<int, double> _positionEntryPricePoints;
 private Dictionary<int, double> _positionEntryVolumes;
 private Dictionary<int, DateTime> _positionEntryPriceTimes;
 private Dictionary<int, double> _increasePositionSizePoints;
       

The “key” is the position number and the “value” is the name of the Dictionary.

So for instance, if I open a German40 position with 3 lots @ 15:00 at the 12345 point, then:

price points would be (1,12345)

entry volume wouldbe (1,3)

entry price times would be (1, 2023/12/05 15:00)

Now if I increase my size by 1.5 lots at 12400 around 16:00, then:

price points would be (1,12345), (2,12400)

entry volume wouldbe (1,3), (2,1.5)

entry price times would be (1, 2023/12/05 15:00), (2, 2023/12/05 16:00)

increase position size points would now be (2,12400)

You get the gist.

I continuously update my Dictionary objects as appropriate so I know exactly where I'm at and what I've done.

You can do something similar for your closings.

 


@firemyst

firemyst
04 Dec 2023, 03:58 ( Updated at: 04 Dec 2023, 08:32 )

RE: cTrader has renko wicks.

cuervotorres.r said: 

In the timeframe selector. And heikin ashi too.

No it doesn't have Renko wicks. It has the Renko Timeframes, but currently do not have the option for displaying Renko Wicks.

 

 


@firemyst

firemyst
04 Dec 2023, 03:57 ( Updated at: 04 Dec 2023, 08:32 )

Would have been nice if you looked through the suggestions first instead of creating another thread to divide up the votes:

 

https://ctrader.com/forum/suggestions/40394

https://ctrader.com/forum/suggestions/40727

 

 

Vote in the above threads as well.


@firemyst

firemyst
04 Dec 2023, 03:50 ( Updated at: 04 Dec 2023, 08:32 )

RE: connection to the account - Error Code 1

PanagiotisChar said: 

Hi there,

You should post your issue in the correct section of the forum and share some more information e.g. screenshots so that the rest can understand what are you looking at

Can we get someone at Spotware to delete this (and other similar posts) from the Suggestions forum? 


@firemyst