Reply

Display Arrows and Crosses when trades Open and Close

5 replies

ianm

Subscriber, bbp_participant, community, 2 replies.

Visit profile

10 years ago #111673

I would like to make an Action so that a green/red arrow displays on the chart when a new buy/sell trade is produced by the EA, and a red cross when a trade is closed.  How can I do this?

0

stearno

Customer, bbp_participant, community, 379 replies.

Visit profile

10 years ago #123678

ianm,

Good request.

 

Basically, you setup your entry and exit rules.  You need to have a rule for each (cannot use SL or TP).

 

Once you have that setup, then go to Get EA.  Change the format to Signals Indicator format.  Save that format to the MT4’s Indicators folder.

 

Open MT4, open the chart, and load the indicator onto the chart.

 

Go into the Input tab of the indicator settings, and there you can change wingdings character for each rule.  By default it is set to 167.  You can change this to be an arrow or an x as you requsted.  Just look at the coresponding winddings number at this website:  http://docs.mql4.com/constants/objectconstants/wingdings

 

I also suggest that you delete the rule text and put whatever works best for you or can leave blank and then it will say what you named the rule tab in EA Wizard.

 

I have attached screenshot of what I did as an exmaple and the example strategy.

 

Good luck.

 

-Stearno

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

10 years ago #123683

Hello,

 

the newest version of EA Wizard already has functions for this, you can find it in THEN action -> Other -> Draw Up Arrow/Draw Down Arrow

 

So you can add this action after you open the trade using Enter at market and it should draw an arrow on the chart.

 

The other possibility is to save your strategy as signal indicator.

Mark
StrategyQuant architect

0

force199

Subscriber, bbp_participant, community, 11 replies.

Visit profile

9 years ago #127668

Hi Mark,

 

I have tried to add the arrow function to my EA so that it shows an up arrow when the last trade closes with a profit and a down arrow when the trade closes with a loss, but the arrow keeps drawing every single second on the bar so I end up with hundred of arrows over that bar instead of just one clear signal.

 

CLOSED P/L in money (1000, 1) < 0

     THEN:  Draw Down Arrow :  Shift: 1

 

 

Also, how do I change the arrow to show a different signal such as a square, or X, what part of the code do I go to?

 

Thanks

0

Mark Fric

Administrator, sq-ultimate, 2 replies.

Visit profile

9 years ago #127907

You should also add condition BarsSinceOrderClosed() = 1 – this will avoid drawing arrow on every bar.

 

– drawing some other character than arrow – this is not that simple, drawing objects to a chart in MT4 is quite complicated, and EA Wizard currently doesn’t allow choosing different drawing types.

It is an idea for next version.

Mark
StrategyQuant architect

0

force199

Subscriber, bbp_participant, community, 11 replies.

Visit profile

9 years ago #128450

Thanks again Mark, you’re feedback is really helping me learn this software, though a bit slowly as I’m not from a programming background.

 

It’s a pity the spammers are trying to ruin this forum.

0

Viewing 5 replies - 1 through 5 (of 5 total)