Forum

Calculating maxvalue and minvalue of a position

Is this code correct to calculate the maximum or minimum price achived by a position? I Used OrderOpenPrice to verifiy if a position is opened. From this max e min values I would like to code a trailing stop. Is it possible? Best regards. int maxvalue() { double Current_high; //new high

Basic EA based on basic StochOsc

Hi. Can someone help me, what is wrong in this simple EA, it doesn't trigger the orders when Stochastic crosses the Signal line. I made the Strategy Test in a 15min timeframe with thousands of bars and total orders are 0. #define MAGICMA 10460211 extern double Lots = 0.1 ; extern double TrailingStop

Some help with the code

I would like to ask someone if could explain what is wrong in this code of an EA with StochasticOsc. This one, with the parameters I chose, gives more than 650 trades with 5237 bars tested since 1st August. I tested in Metastock and gives about 200 trades. Best regards. #define MAGICMA 20050610

Bad Signals from Strategy System

Greetings. The Strategy System is giving bad signals that shouldn't occur according to the indicator. What could be the problem? Does anyone has experienced the same problem? Best regards

BarsSince ???

Hi. I am very new to MQL4, so I don't have much experience programing with this language. I am used to Metastock EA language, wich is far different from MQL4. So I would like to know if there is a way to express a function similar to Metastock function "BarsSince(EventXX)". In other words, I need a