Forum

Multi-colored trend line

Hi, I've modified the built in ' Moving Average ' indicator so that it should show a red line when the trend is going down and a green line when the trend is going up. However, the line is always red whether the trend is going up or down. Can anyone see where I'm goin wrong? //--- indicator settings

Persistent save location

I'm starting to experiment a bit with a neural network library in MT5. The library has some handy load and save methods which are useful to retain the network weightings between separate runs of the EA. I'm about to implement the load/save functionality but this leads me to my problem; Normally EAs

Brokers and MT5

Hi, I've opened a couple of demo accounts with certain brokers that don't seem to work with the standard MT5 platform (downloaded at metatrader5.com) but force you to download their own version of the app instead which is very inconvenient as you end up with several version of the app installed

Invalid Price on a BuyStops of BuyLimit order

When I try to create a BuyStops of BuyLimit order which is too close to the current Ask price (even though the price I want to buy at is the correct side of the Ask price) I get an invalid price error. Is there any way I could detect when this will happen before attempting the order

Detect optimization mode programmatically

Sorry if this has been asked before but I'm finding it a bit difficult to search for. I have an expert that writes out a lot of information to CSV files. The problem is, if I forget to turn this off before I start optimization, it will write these CSV files for every thread that it uses. These then

Broker Statistics

I'm not sure if this is the best place to put this but it does contain the code for an EA so here goes. The attached EA for MT5 is designed to be back-tested and will output key information about your broker's configuration in the journal window. I was thinking it could be a useful tool to compare

Reliably prevent 'invalid stops'

Hi everyone. I'm using the StopsLevel() and FreezeLevel() methods of the CSymbolInfo class to help calculate the minimum stop-level for an open position. I'm getting 40pips returned in StopsLevel() for EURUSD so I'm subtracting 0.0004 from the ASK price before placing a BUY order. My problem is that

How to trade with the smallest stop-loss

Hi, in the particular trade I'm creating I want to open a position with the smallest stop-loss that my broker will allow. I've modified some code I found on these forums but it's still not working right and I'm not sure what I'm doing wrong. Here's a snippet of my code: if (type == POSITION_TYPE_BUY

Live update not working

I have MT5 loaded on 2 machines but one is regularly asking me to update and the other is not. The one that doesn't also wont update by selecting Help-> Check Desktop Updates->Latest Release Version from the main menu. I've also tried reinstalling the software by downloading again from