Topics
Replies

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

firemyst
01 Nov 2019, 10:47

RE:

Panagiotis Charalampous said:

Hi FireMyst,

There is a RemoveObject function for this.

Best Regards,

Panagiotis

Awesome!

Thank you @Panagiotis.

For everyone else's FYI, you have to call it like:

Chart.RemoveObject(chartKey);

 


@firemyst

firemyst
31 Oct 2019, 02:47

It seems to me your issue is referencing the dll class file.

I don't believe CsvWriter is standard issue C# .Net library.

I'm guessing you want CsvHelper.CsvWriter class? If so, you need to add a reference to your project for the CsvHelper dll assembly.

The only way you can do that is if you've downloaded and installed the CsvHelper dll file somewhere on your computer.

Do a google search, and you'll see you can download it here: https://joshclose.github.io/CsvHelper/


@firemyst

firemyst
30 Oct 2019, 09:20

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Thanks I got it. It has been forwarded to the product team.

Best Regards,

Panagiotis

HI @Panagiotis:

Any updates on this issue? I'm hoping to be able to use those indicators in templates again soon.

Thanks!


@firemyst

firemyst
23 Oct 2019, 10:39

RE:

Panagiotis Charalampous said:

Hi tentcows,

cBot instances run on different threads but they are still controlled by the main UI thread. So if a high number of cBot instances is running on one cTrader instance then this might cause some bottlenecks. I would propose a hybrid solution, to have 3-4 cBot instances running on each cTrader instance.

Best Regards,

Panagiotis

Great tip for everyone @Panagiotis ! Thanks for sharing!


@firemyst

firemyst
22 Oct 2019, 16:18

RE:

Panagiotis Charalampous said:

Hi FireMyst,

Just take them of the charts.

Best Regards,

Panagiotis

HI @Panagiotis:

I've sent a message with how to reproduce the issue, along with the necessary indicators attached and a screen capture too showing the indicators on the screen.

Hopefully your team can reproduce it too.

 


@firemyst

firemyst
22 Oct 2019, 10:30

RE:

Panagiotis Charalampous said:

Hi FireMyst,

It seems you are using a number of custom indicators which might be the root of the problem. We will need to have these indicators to determine if they are causing this. In the meanwhile, can you please remove them and let us know if the issue persists?

Best Regards,

Panagiotis

I can try. Would you be able to clarify what you mean by "remove them"?

1) take them off all charts?

2) remove them from the C:\Users\<username>\Documents\cAlgo\Sources\Indicators folder?

3) something else?

Thank you.


@firemyst