Blue/Red arrows on chart when a position is opened/closed?

To add comments, please log in or register
rwb181
107
rwb181  
Hello all, I have been trying to figure this one out for some time now but am still stumped. When I open and close trades with my scripts, I get blue and red arrows (with a connecting dotted line) on the charts showing where the trade was opened/closed. I know why that is (because of the color parameter passed with the Order Open/Close functions that are in the scripts), but I can't figure out how to get those same arrows when I use the "New Order" command from the toolbar located above the charts. I've searched for the answer but haven't found it yet. Anyone know how to do this? Ron
bernd
989
bernd  

Attach this as an indicator:

#property indicator_chart_window

#include <common_functions.mqh>

int start(){
   plotNewOpenTrades();
   plotNewClosedTrades();
}
You will need the common_functions library which can be found here: https://sites.google.com/site/prof7bit/common_functions
rwb181
107
rwb181  
Hi 7bit, And thanks! I see by your reply that there is no "Option" or "Preference" button that can be switched in the MetaTrader terminal that will allow this to happen and that a special set of functions need to be ran to place the arrows on the chart showing opened/closed positions. I downloaded the common functions file to my "include" folder and copied your text to a word document. I'll turn it into an indicator later today (if I get time) and will see how it works this week during my trading sessions. Thanks again and have a great day! Ron P.S. And thanks for the link! I'm always looking for sites that can help me learn more about the meta quote language and ways to work with it.
bernd
989
bernd  
rwb181:
copied your text to a word document.

These are not word documents. mql4 files are text documents. You usally use MetaEditor to edit or create them. Otherwise you can use notepad for plain text documents or a more capable text editor like notepad++ or SciTE or JEdit or any other text editor (there are plenty of them).


Word is a complicated word processor and only useful for writing letters and other documents with formatted text and things like that and has a complicated file format that has nothing to do with plain text and while being good at making nicely formatted letters word lacks a lot of (almost all) features that are needed when editing program source codes. In programming we only deal with plain text documents and these are best used with a text editor.
rwb181
107
rwb181  
I realize that these are not word documents. I usually have Word open and I will use it as a text editor when I have small pieces of text to copy to the clipboard. It is simply easier than opening another program just to copy (as in this case) 3 small lines of text that I can retrieve later and paste into a new custom indicator that I created in MetaEditor. If I was copying a large piece of programming language, I would use notepad and not word. My apologies if I created any confusion. By the way, I did have time, it is done and works fine. Thank you for your help.
To add comments, please log in or register