Replies

jim.tollan
23 May 2023, 16:52 ( Updated at: 21 Dec 2023, 09:23 )

RE:

lindawati92sufi said:

i buy 0.2 lot eur/usd at 18th and closed it in 19th today
i should pay swap 1.5usd not 15usd

apologies if this was explained in the post with your other alias, but it would appear that this was an issue at the broker end and all affected trades were reversed.

much as this is painful at the time, i've found that these issues are usually a glitch on the broker side and are usually resolved within a small timeframe.


@jim.tollan

jim.tollan
23 May 2023, 16:20 ( Updated at: 23 May 2023, 16:25 )

RE: RE: RE: RE: RE: RE: RE:

meeting.chegini said:

firemyst said:

meeting.chegini said:

Dear friend, do you want to teach me how to split the nucleus of an atom?

This is a simple question! If you know the solution, please guide me

How to split the nucleus of an atom: there's plenty of "how to's" on Google and YouTube already on how to do it.

Guiding you on this issue - I already started. Second post in this thread is how you would start going about doing it through C# code. If you're not trying by writing any code, I'm not writing code for you. Best way to learn is to do it on your own.

If you're just looking at the chart and wondering where they are on the chart, then look for the indicator name on the chart:

 

If the name of the indicator isn't on your chart, then put it there by choosing to display "Indicator Titles":

 

 

I wanted to find out through C# what oscillators are placed on the chart, but I couldn't find a solution. And I think there is no way
And I respect your wrong way of thinking.
Good luck.

You seem to be under the illusion that firemyst is one of your employees. I suggest you adopt a better bedside manner. Thereafter, you'll be pleasantly surprised at the number of folk that  that will be willing to help out with any issues you have. Until then - business as usual.

FWIW - this was the extended approach that firemyst was alluding to:

foreach (var indicatorArea in Chart.IndicatorAreas)
{
    foreach (var indicator in indicatorArea.Objects)
    {
        Print($"Indicator => Area: {indicatorArea.GetType().Name} Name: {indicator.Name}");
    }
}

Whilst it is frustrating to not be presented with the answer that you WANT, sometimes you just have to be grateful that folk have taken the time to point you in the right direction.


@jim.tollan

jim.tollan
22 May 2023, 10:57

While I understand your motivation, I think there are definitely many issues in this thinking:

1. The skillset required for desktop (c++/c#) will differ from the web front end (probably using React)

2. A single codebase would be unable to target both platforms, so you'd still effectively require two teams/sets of code

3. The actual mechanics of rolling out code and testing are very different between desktop and web based

4. A feature may be super easy to deliver in one platform but not in the other. so you have conflicts on whether to include that feature

This is just the very top level few that occurred to me. I think we all do have a tendency to underestimate the challenges in keeping platform targets in sync. There is definitely a case for having as many common functions present in both platforms, and I'm sure the product lead will be juggling these priorities as we speak ;)

Let's see how well my contribution on this AGES as cTrader continues to evolve - lol


@jim.tollan

jim.tollan
19 May 2023, 11:01

RE: RE: RE:

lisandronahuelhillebrand said:

Yes, I am aware of your proposal and I up-voted it. I just wanted to put it again to raise attention at Spotware. Thanks for your comment.

 

jim.tollan said:

lisandronahuelhillebrand said:

Is it possible to program a cBot/system to do walk-forward testing for algos on cTrader? Or is Spotware considering adding this feature to the platform in the near future?

yes, i weirdly proposed an approach for this in this thread:

it's definitely a must have in my opinion. might be worth upvoting that thread also, plus adding some further commentary..

 

yup -i agree it's well worth keeping it in the spotlight. That said, i have a feeling that not many folk have explored the topic nor realised the advantages of such a feature. This is demonstrated by the low upvote count on the proposal. Of course, it could be that this type of feature has no appeal for the wider audience - hence the lowish upvote count.

I believe our friend The Nomad Trader has also cottoned on to the huge benefits of this and explains in laypersons terms the key benefits: 

 

 


@jim.tollan

jim.tollan
18 May 2023, 14:32

RE:

lisandronahuelhillebrand said:

Is it possible to program a cBot/system to do walk-forward testing for algos on cTrader? Or is Spotware considering adding this feature to the platform in the near future?

yes, i weirdly proposed an approach for this in this thread:

it's definitely a must have in my opinion. might be worth upvoting that thread also, plus adding some further commentary..


@jim.tollan

jim.tollan
16 May 2023, 13:27

RE:

firemyst said:

That is one thing that is soooooooooooooooooo annoying with the API's Spotware created as they're not consistent across indicators.

I wrote my own multi time frame fractal indicator. Basically, I did it by getting the bars data series time frame I wanted, and then doing the calculations (eg, looking for the midpoint between x number of bars, making sure "x" is an odd number).

 

Is this something that you'd be willing to share?? I'm not so interested in a visual indicator,. I'm more interested in using the data generated from the multiple instances... You of course kindly point out an approach, but it would be nice to have (even a cut down) version of the code if that wasn't giving away any IP.

cheers

jim


@jim.tollan

jim.tollan
04 May 2023, 12:58

RE: how do we vote for the offline backtesting request.

davidmwabuka said:

please add this funtionality, to store download tickdata and backtes

you click on the thumbs-up on the original post..;)


@jim.tollan

jim.tollan
04 May 2023, 12:47 ( Updated at: 08 May 2023, 17:33 )

OMG - I literally navigated to the suggestions section to suggest this very idea.

Here's how i see it working:

1. Define the DateRange of the optimisation run

2. Define a sliding window (percentage) of which data is used for the backtest and which data is used for forward testing - i.e. 80/20, 90/10 etc

Having a combined *window* on the data that accommodated backtesting with out of sample data would truly be a gamechanger.

-----------------

FYI - I currently do this in a number of ways:

1. Select a daterange (say 01/01/2017-01/05/2023)

2. Set the Optimization daterange from 01/01/2017-30/04/2022

3. set the Backtest daterange to 01/05/2022-01/05/2023

4. Run the optimisation

5. From the optimisation, select the candidate set and apply it to the backtest window

6. rinse and repeat

----------------

It's quite cumbersome, but works. Combining this behaviour into the optimisation window would be amazing and offer huge insights.

Hope you get the gist. Still revelling at the weirdness of the timing of this request

 


@jim.tollan

jim.tollan
20 Apr 2023, 12:03 ( Updated at: 20 Apr 2023, 14:56 )

RE:

Hello there - would this not work:

            var profitPanel = new StackPanel
            {
                HorizontalAlignment = HorizontalAlignment.Left,
                VerticalAlignment = VerticalAlignment.Bottom,
                BackgroundColor = Color.Black,
                Opacity = 25,
                Margin = 5
            };

looks like the Opacity property would fit the bill... (?)


@jim.tollan

jim.tollan
19 Apr 2023, 17:47 ( Updated at: 20 Apr 2023, 11:57 )

RE:

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.


@jim.tollan