Replies

heliodorstar
23 Oct 2020, 12:05

Thanks very much for your answer, Panagiotis!

I decided to follow through your advice and first created a dictionary of type <string, List<Position>>.

After that I looped through all open positions and added them to the above dictionary using the pair name as a key.

Then I cycled the keys of the dictionary and did my calculations for every single pair and closed all suitable positions using:

Parallel.ForEach(
	dict_pos[pair],  // #dict_pos being my pair positions dictionary
	pos => close_pos_async(pos)
	);

where #close_pos_async is simply:

private void close_pos_async(Position pos)
	{
        ///<summary>Performs asynchronous close of a position.</summary>

		ClosePositionAsync(pos);
    }

 


@heliodorstar

heliodorstar
25 Sep 2020, 08:40

I am going to start converting the MQL4/5 code Murrey Math to cAlgo

Hi,

It has been a while since the first post was made. Still I need the Murrey Math indicator and since cAlgo is my main developer platform I shall need it in C# code.

First I am going to convert only the math logic that I can use in my trading robots {2 of them for now!}. Later I shall try to master the visual side which might prove to be more challenging.

Since I have used so much free code up to now (mainly on MT4 platform) I am going to release the code for free as a small giveback.

Take care!


@heliodorstar

heliodorstar
23 Sep 2020, 23:41

Here is what I found on the matter...

So basically in cAlgo they don't have a message or alert popup so you have to used the generic System.Windows.Forms which should be referenced from "Manage References".

 

By default the AccessRights of the robot are set to None and when you try to access System.Windows.Forms you get a pretty nasty error. That thing alone cost me the whole evening looking for and testing all kinds of weird stuff.

Two things are to be done here: 1. First in Control Panel > Administrative Tools > Microsoft Net > Runtime Security Policy > Adjust Zone Security you need to put almost everything {except Untrusted Sites} to "Full Trust". And 2) {Yepp, you guessed right!} you need to change the robot AccessRights to "FullAccess". I assure you it is very easy to do when you know it ;)))

Next thing you write in your algo:

using System.Windows.Forms; // Of course ;)

...

var message = MessageBox.Show("New bar!"); // end of code

 

...and Voila! You get a really ugly Message {or Alert} Box!

I gonna find a way to make the thing much more pretty for I can't stand the present "beauty" of it for 15 hours a day!


@heliodorstar

heliodorstar
09 Sep 2020, 12:09

RE:

PanagiotisCharalampous said:

Hi heliodorstar,

If you notice, the problem is in 3.7. The dash-dotted line was available twice. This has been fixed in 3.8.

Best Regards,

Panagiotis 

Join us on Telegram

Well, the pattern of the line on second row (blue "2") is not the same as the one on the 5th row (red "1").

 

So it is not a bug and you didn't fixed it! You just made a change you shouldn't have done!

 

The dotted lines on rows 3rd and 4th are also different. I am not going to make screenshots of them too since it seems it is OK with you.

 

I wonder if someone has written an indicator using the design of those lines how does he feel about the new design now? And what about if anyone has actually bought that indicator - how does he feel about that too? Do you happen to ask yourselves questions like these?

 


@heliodorstar

heliodorstar
09 Sep 2020, 11:49 ( Updated at: 21 Dec 2023, 09:22 )

RE:

PanagiotisCharalampous said:

Hi heliodorstar,

Can you please send us some screenshots of the issue so that we can check?

Best Regards,

Panagiotis 

Join us on Telegram

Here is a picture of 3.7 (the origianl drawing lines)

cTrader 3.7
cTrader 3.7

And here is the new version (3.8)

cTrader 3.8
cTrader 3.8

On both screenshots a pitchfork in the same red color is drawn. In 3.7 the line used to be "dash-dotted" line and now the same line is just "dotted line". In the context menu you can the difference between the lines marked with red "1" and blue "2".

Hope the problem is clear enough...

EDIT: Not sure if you can see the difference clearly:

Bigger view of 3.7:

And bigger version of 3.8:


@heliodorstar