Topic: Custom order comment

Hello,
I am wondering if maybe I can add in an EA-Studio expert a "Custom order comment" (as suggested in the wish list) myself, using following line (from FSB experts):

static input string Order_Comment = ""; // Custom order comment

Or do I need more,
Thank you for any advise.

Re: Custom order comment

I think you can, try it out. If something comes up, report back and lets work through it.

Re: Custom order comment

Add the following line at the beginning of the expert. This will allow you to enter a comment on the expert's Input tab.

static input string Order_Comment = ""; // Custom order comment

http://s10.postimg.org/ktp22ch8p/screenshot_193.png

Set the EA to attach the comment to a position. You have to modify the OpenPosition function. There are two ways:

Variant 1.  replace the default comment (the EA's magic number)

// Replace

 string comment    = IntegerToString(Magic_Number);

// with

      string comment    = Order_Comment;

http://s10.postimg.org/oh9em5etl/screenshot_194.png


Variant 2. Add your custom comment to the EA's magic number:

string comment    = IntegerToString(Magic_Number) + ' ' + Order_Comment;

http://s10.postimg.org/z5d5kzosp/screenshot_195.png

Re: Custom order comment

Thank you very much, I will try and report

Re: Custom order comment

Hello,
1. I managed to create the field in the expert input tab, tha is o.k.
But it still does not show in the comment (Kommentar)-field when running in MT4.
(Only as long as I put the cursor over the empty field, it shows the order number and the EA-ID)
http://up.picr.de/28816229ky.jpg
2. I do not know how to modify (Variant 1 or 2) the "OpenPosition" because in my EA-Studio created EA it looks completely different to the example in your suggestion.
http://up.picr.de/28816230ng.jpg
3. In the EA's created with FSB I found only one "Order_Comment" line, but there it works and is shown in the Kommentar-line.
http://up.picr.de/28816232ae.jpg
Do you have an idea what I am miss, maybe it is not as easy as I thought

Re: Custom order comment

You have to expert your EA again because I updated the code just before writing my previous posts.
Then you have to apply the shown changes.

Re: Custom order comment

I have tried both variations and they work fine.
And if I do not change anything now in the updated version the Magic Number is shown.
Thank you very much.
http://up.picr.de/28820377uf.jpg