Topics
Replies

firemyst
05 Dec 2019, 02:11 ( Updated at: 21 Dec 2023, 09:21 )

RE:

PanagiotisCharalampous said:

Hi FireMyst,

https://ctrader.com/forum/ctrader-support/22129 Yes

https://ctrader.com/forum/ctrader-support/21482 No

https://ctrader.com/forum/ctrader-support/21540 No 

https://ctrader.com/forum/calgo-support/21534 No

Please join our Telegram group where we report such updates e.g. 

Best Regards,

Panagiotis 

Join us on Telegram

 

HI @Panagiotis:

Thank you for the updates. I think you need to at least update thread 22129 then to indicate to everyone it has been resolved :-)

As for Telegram - we have the forums - how hard is it to create a separate forum and/or a read-only thread and include the updates there? Users should not have to download another application and join yet another Spotware group in that application to now find out the latest updates.

Or is Spotware going to put a Directory on their website that tells users what they should do and where they should go to get certain information?

  •  Spotware.com -> product information, sales information, download actual products
  •  Facebook -> latest sales/marketing promotions
  •  cTrader.com -> forums and latest API announcements
  •  Telegram -> latest change release logs

etc etc etc.

Getting a bit ridiculous don't you think?

How many 3rd party applications, services, and systems does Spotware want us to sign up to in order to use and get information on their products?

 

 

 

 


@firemyst

firemyst
04 Dec 2019, 11:19

RE:

PanagiotisCharalampous said:

Hi FireMyst,

At the moment there is no release notes for minor updates. We try to update the relevant threads when fixes are released and also report the changes in our Telegram group.

Best Regards,

Panagiotis 

Join us on Telegram

 

No worries.

Have any of these been fixed yet?

http://ctrader.com/forum/ctrader-support/22129

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

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

 

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

(if your response, " That is not so clear, currently in that case `TradeResult.IsSuccessful = true; TradeResult.ErrorCode = null`. In future versions it will be more clear, `ErrorCode` won't be null. " has been implemented yet?)

 

Thank you.


@firemyst

firemyst
04 Dec 2019, 02:50

RE: RE:

alphabet_asa said:

PanagiotisCharalampous said:

Hi alphabet_asa,

PipValue will give you the value of a pip in your account's currency. If your account currency is the same with the quote currency then PipValue and PipSize will match.

Best Regards,

Panagiotis

Thank you for the reply! If that's the case then how do I get the currency's exchange rate?

HI @alphabet_asa:

Unless I'm missing something, isn't that what the Forex quote (Symbol.Bid, Symbol.Ask) is showing?

For example, if you're looking at the AUDUSD forex pair, and the price quoted is 0.68, then the exchange rate is 1 AUD = $0.68 USD.

Similarly, if you're looking at USDAUD, and the price quoted is $1.46, then the exchange rate is 1 USD = $1.46 AUD.

If you're looking at a foreign market index, then lookup the forex pair of your currency vs that index's currency. Thus, if you're trading the US Dow (US30), and your local currency is New Zealand Dollars, then get the symbol price for either USDNZD or NZDUSD, following the examples above depending on which currency is listed first in the forex pair.


@firemyst

firemyst
04 Dec 2019, 02:37

RE:

tgjobscv said:

How reverse profitable green to red color ?!!!!!!!!!!!!!!!!!!!!!!!!!!!!

How reverse less red to green ?!!!!!!!!!!!!!!!!!

Where is setting ?

 

Why ?

Becouse green relaks me.

Red increse.

I know I suggested and provided this feedback to Spotware a while ago too. Every other charting package allows the user to set different colors for indicators to show whether their values are increasing or decreasing. For whatever reason, Spotware hasn't implemented this basic feature. So until then, it's left to you as the user to either develop your own indicator which does it, or find indicators that have the option.


@firemyst

firemyst
29 Nov 2019, 13:36

RE:

PanagiotisCharalampous said:

Hi FireMyst,

Yes please, if you can record a video it would be helpful.

Best Regards,

Panagiotis

I've figured out how to reproduce it one way.

1) Create an indicator where Overlay = false

2) Load it onto a chart in cTrader and set a Level property of 0 to color yellow.

3) Save the chart as a template

4) load the indicator's source code in Visual Studio

5) make some changes to it.

6) Save and recompile the indicator

7) Load up cTrader

8) The Level 0 line on the indicator will probably be gone

9) reload the template

10) the line reappears

11) close and reopen cTrader. The line disappears again.

12) reload the template to have the line reappear

13) change the visual studio code and recompile the indicator

14) the Level 0 line will reset and disappear again.

15) reload the template

16) close cTrader

17) reopen cTrader and the line is gone again.

18) delete the indicator.

19) reapply the indicator to the chart and change the level 0 line to yellow.

20) save the template.

21) close/reopen cTrader.

Now the line will stay on the chart until the code is updated again. At that point, the settings for the Level lines do not stay.

 

Hope this helps.


@firemyst

firemyst
27 Nov 2019, 16:55

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Any chance we can get the indicator code?

Best Regards,

Panagiotis

Yup. Here it is. Looking at it further now, it seems like the values might be changing slightly for the lines to disconnect, but then I don't understand why the lines reconnect when it's redrawn.

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

namespace cAlgo.Indicators
{
    [Levels(0.0)]
    [Indicator("OSMA (DaveLoz)", IsOverlay = false, AccessRights = AccessRights.None)]
    public class OSMA : Indicator
    {
        [Parameter()]
        public TimeFrame SourceTimeFrame { get; set; }

        [Parameter(DefaultValue = 12)]
        public int ShortCycle { get; set; }

        [Parameter(DefaultValue = 26)]
        public int LongCycle { get; set; }

        [Parameter(DefaultValue = 9)]
        public int Period { get; set; }

        [Output("UpTrend", LineColor = "Green", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries UpTrend { get; set; }

        [Output("DownTrend", LineColor = "Red", PlotType = PlotType.DiscontinuousLine, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries DownTrend { get; set; }

        [Output("Main", LineColor = "Cyan", PlotType = PlotType.Line, LineStyle = LineStyle.Solid, Thickness = 2)]
        public IndicatorDataSeries Result { get; set; }

        MacdHistogram macd;
        private MarketSeries _marketSeries;
        private DataSeries _dataSeries;
        private double _result = 0;
        private double _resultIndexMinus1 = 0;
        private int _previousIndex = Int32.MaxValue;
        private int _trend = 0;

        protected override void Initialize()
        {
            if (SourceTimeFrame != null)
                _marketSeries = MarketData.GetSeries(Symbol.Name, SourceTimeFrame);
            else
                _marketSeries = MarketData.GetSeries(Symbol.Name, MarketSeries.TimeFrame);

            _dataSeries = _marketSeries.Close;
            macd = Indicators.MacdHistogram(_dataSeries, ShortCycle, LongCycle, Period);
        }

        public override void Calculate(int index)
        {
            int altIndex = index;

            if (MarketSeries.TimeFrame != _marketSeries.TimeFrame)
            {
                altIndex = _marketSeries.OpenTime.GetIndexByTime(MarketSeries.OpenTime[index]);
            }

            if (altIndex < 2)
                return;

            _result = macd.Signal[altIndex] - macd.Histogram[altIndex];
            Result[index] = _result;
            UpTrend[index] = Double.NaN;
            DownTrend[index] = Double.NaN;

            _resultIndexMinus1 = Result[index - 1];

            if (_previousIndex < altIndex)
            {
                DownTrend[index] = Double.NaN;
                UpTrend[index] = Double.NaN;
                if (_result > _resultIndexMinus1)
                {
                    UpTrend[index] = _result;
                    UpTrend[index - 1] = _resultIndexMinus1;
                    if (UpTrend[index - 1] == DownTrend[index - 1] && UpTrend[index - 2] == DownTrend[index - 2])
                    {
                        DownTrend[index - 1] = Double.NaN;
                    }
                    _trend = 1;
                }
                else if (_result < _resultIndexMinus1)
                {
                    DownTrend[index] = _result;
                    DownTrend[index - 1] = _resultIndexMinus1;
                    if (UpTrend[index - 1] == DownTrend[index - 1] && UpTrend[index - 2] == DownTrend[index - 2])
                    {
                        UpTrend[index - 1] = Double.NaN;
                    }
                    _trend = -1;
                }
                else
                {
                    DownTrend[index] = Double.NaN;
                    UpTrend[index] = Double.NaN;
                    if (_trend == 1)
                    {
                        UpTrend[index] = _resultIndexMinus1;
                    }
                    else if (_trend == -1)
                    {
                        DownTrend[index] = _resultIndexMinus1;
                    }
                }
            }
            else
            {
                UpTrend[index] = Double.NaN;
                DownTrend[index] = Double.NaN;
                if (_trend == 1)
                {
                    UpTrend[index] = _resultIndexMinus1;
                }
                else if (_trend == -1)
                {
                    DownTrend[index] = _resultIndexMinus1;
                }
            }
            _previousIndex = altIndex;
        }
    }
}

 


@firemyst

firemyst
27 Nov 2019, 10:15 ( Updated at: 21 Dec 2023, 09:21 )

Here's the PSAR again in the middle of the candle. UK100 M1 chart from today. Pepperstone cTrader v3.6


@firemyst

firemyst
20 Nov 2019, 14:59 ( Updated at: 21 Dec 2023, 09:21 )

RE: RE:

One more example -- the candle just went through the PSAR, then came back up. But it flipped the PSAR as expected because the "close" price passed through it to form the low:


@firemyst

firemyst
20 Nov 2019, 14:46 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Shouldn't it be flipped when the close price passes through and not the high/low?

Best Regards,

Panagiotis

Yes. And the CLOSE did pass through it. When a candle is open, the close is the current price until the actual candle closes. I believe that's what the cbot frame returns with MarketSeries.Close.Last(0) for every OnTick.

Thus when the price went down through the PSAR to form the low, the close would have passed the PSAR, and should have flipped it.

Here's an example from another broker's platform:


@firemyst

firemyst
20 Nov 2019, 11:26 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Panagiotis Charalampous said:

Hi FireMyst,

The fix should arrive soon.

Best Regards,

Panagiotis

It's still happening in Version 3.6 as you can see:

It wasn't flipped when the candle passed through it.

 

 


@firemyst

firemyst
13 Nov 2019, 16:44

I haven't forgotten -- just haven't been able to reproduce this issue in a way to record a video. I just got a cTrader update for Pepperstone today, so it may be resolved too.

If it does happen and I'm able to reproduce, I'll post here to let you know before sending a video.


@firemyst

firemyst
07 Nov 2019, 02:41

@Panagiotis:

I've had the same issue as @zedodia, but haven't been able to pin it down to specific steps to reproduce. If your team needs to see it, the best I can probably do is record a small video showing how I set andsavea template, and then come back later, have the workspace load, and not all the template settings are held.

 


@firemyst

firemyst
06 Nov 2019, 09:35 ( Updated at: 21 Dec 2023, 09:21 )

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Can you try installing the package using NuGet? I just did it and works like a charm.

Best Regards,

Panagiotis

Thanks for the suggestion. I did this twice through Visual Studio.

The first time I thought it went ok as everything worked in Visual Studio.

With your reply, I went through and did it again, and like you said, it's working for me now too.

So thank you. I'm not sure what happened the first time around. I suppose I should have tried installing it again before posting. :-/


@firemyst

firemyst
06 Nov 2019, 02:40

RE:

zedodia said:

I have done this so many times its now past frustrating. When i save a layout, and switch between layouts, not all layouts stay saved. For example, no matter how many times i save a layout, when i revert back to it, it takes ctrader out of full screen, and makes the tradewatch cover around 75% of the ctrader program. and the layout had no trade watch active when saved (everytime). Templates are a little better, how ever i find if i save a new setting over an old template, the new setting does not save.

 

is this a bug everyone has drama with? or just me? its been happening for along time.

I've found that with templates, when I save one that includes Indicators where "IsOverlay = false" with a level line color defined (eg, I put a dotted yellow line on level 0), it doesn't always remember when I exit cTrader and then come back later or the next day. So I have to right-click and select the template to reload it with the level lines drawn in the correct color instead of the default black.


@firemyst

firemyst
06 Nov 2019, 02:36

RE:

Panagiotis Charalampous said:

Hi frank.bellio,

We have plans to add swaps to the Symbol class but we do not have an ETA for this yet.

Best Regards,

Panagiotis

HI @Panagiotis:

Just a quick follow up to see if Spotware has any updates on this request for the community or if there's a timeline ETA yet?

Thank you.


@firemyst

firemyst
06 Nov 2019, 02:28

RE: RE: RE:

alex_mihail said:

FireMyst said:

 

If you want to draw text on a chart, Chart.DrawText is your friend:

Example:

Chart.DrawText("X text", "X", MarketSeries.Close.Count - 1, Symbol.Bid, Color.Goldenrod);

You can also search for examples:

https://ctrader.com/search?q=DrawText

Not text - I want to draw a shape ("X" for example) on the candlestick when the price crosses over Hull MA.

Then you have to draw lines. But you'll have to decide how far you want the lines to extend, and how steep ofan angle to form the "x". For instance, you might have to draw one line with the coordinates (x-2, priceCrossPoint + 2) and (x+2, priceCrossPoint - 2). That will draw from top left to bottom right. You'll have to do the same for the other leg.

The DrawText approach is a lot simpler to get started so you can see if you like how it's working. Then from there I would graduate to drawing the lines to form the X.


@firemyst

firemyst
06 Nov 2019, 02:17

RE:

vikkineshwar said:

Hi Friends,

 

I am looking for a perfect cbot/Algo which can perform well (10%-15% monthly) and a DD upto 35%, is there any with good support ? 

Of course there is. That's why everyone has time to be on these forums -- their copy of the bot is running, bringing in money for them while everyone else in the world has to work. ;-)


@firemyst

firemyst
01 Nov 2019, 16:03

RE:

Panagiotis Charalampous said:

Hi FireMyst, 

Indeed that solves the issue but in a weird way :)  What I would havedone would be to exit the method if the closed position was not created by this instance. See below

        private void Positions_Closed(PositionClosedEventArgs args)
        {
                Position p1 = args.Position; 
                if(p1.Label != _positionLabel) 
                   return;

Best Regards,

Panagiotis

 

 

Nice one. I like it. I'm going to use it. Thanks! :-)


@firemyst

firemyst
01 Nov 2019, 15:48

RE:

Panagiotis Charalampous said:

Hi FireMyst,

You do not check anywhere if the closed position was actually created by this instance. So if it has been created by another instance on the same symbol then the positions of this instance will be closed as well.

Best Regards,

Panagiotis

Thanks!

I found the bug thanks to your feedback. I had to change the foreach loop to the following, replacing _positionLabel with p1.Label:

foreach (Position p in Positions.FindAll(p1.Label, Symbol.Name))
{ /... }

 

 


@firemyst

firemyst
01 Nov 2019, 14:14

RE:

Panagiotis Charalampous said:

Hi FireMyst,

You should add a condition in Positions_Closed to be executed only when the closed position has the same same label as _positionLabel. Else the method will be executed when positions from other instances are closed, eventually closing all positions of the account.

Best Regards,

Panagiotis

Hi @Panagiotis:

I do that don't I?

Line 56.

I only get the historical position that has the same label, symbol, and tradetype as the position that was closed.

I then check to make sure it's found (eg, the historical trade isn't null).

The next if statement on line #58 will only evaluate to true if the exact matching historical trade is found.

So to me it looks like it's finding everything under the symbol, regardless of the label. Otherwise, HT would be null.

?


@firemyst