
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Going back to the issue of determining stoplosses and takeprofits in the OnTradeTransaction event. I have the following log outputting all fields of the structures (taken from MetaQuotes example), and this is no longer a tester but an online contest. Here we have a buy:
And here it closes on Take Profit:
The only thing that unites these transactions is price(close price equals the TP price). Question - is that the way to determine the fact of TP? Imho, inconvenient and ambiguous (if I remember correctly, the exact TP price may not happen and TP will be closed at the nearest other price).
Good afternoon! I apologise in advance, maybe I'm being obtuse, or I don't understand some obvious things. I'm trying to use iMA indicator, trying to write according to examples I've read.
In general, I try to do it this way. I declare at the top, above all functions of EA.
Then I use a function that will work in OnTick() function. In the sample, the function itself is at the bottom. In fact, for now, I will use only the last-zero value of the array.
I will only use the last-zero-value.
Error 'a_timeframe' - can't convert enum Owl.mq5 2009 28
Regarding this imino variable, it's in the string-type instruction, you see it's glowing blue itself...
Writes error 'a_timeframe' - can't convert enum Owl.mq5 2009 28
Thank you!!! Is it the same as double, string or int? I don't understand, sorry, where do I put this type?
Alright, thanks!
This is purely a tester bug. Trans.price_tp field in case of TRADE_TRANSACTION_DEAL_ADD may contain 0 or any rubbish. On-line trading outputs everything correctly.
Please advise why the request.type_filling=ORDER_FILLING_AON; line in the EA contains the error 'ORDER_FILLING_AON' - undeclared identifier cs2011.mq5 127 28 in version 697
Please advise why the request.type_filling=ORDER_FILLING_AON; line in the EA contains the error 'ORDER_FILLING_AON' - undeclared identifier cs2011.mq5 127 28 in version 697
Because the language has changed since the EA was written.
put request.type_filling=ORDER_FILLING_AON in this line;
request.type_filling=ORDER_FILLING_FOK; and good luck.
Or you can just put 0
request.type_filling=0;
will also work.
PS or alternatively (to avoid having to edit the entire EA) you can put a patch at the very top of everything
#define ORDER_FILLING_AON ORDER_FILLING_FOK
This is just in case ORDER_FILLING_AON is mentioned several times.
For some reason I see the following picture: when I paste in the terminal an indicator from the Navigator to a chart, an empty area for the indicator appears on the chart, the indicator itself is not displayed, but if I open the list of chart indices, it appears there with the note "Debugging". What is this bug and how do I cope with it?
Good people, help!
Take the simplest code.
#property copyright "Copyright 2011,"
#property link "http://www.mql5.com"
#property version "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---
double Vhod;
Vhod=linfunc(15);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Expert deinitialization function |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
{
//---
}
//+------------------------------------------------------------------+
//| Expert tick function |
//+------------------------------------------------------------------+
void OnTick()
{
//---
}
//+------------------------------------------------------------------+
double linfunc(int b) // имя функции и список параметров
{
double a;
while((a/b)<1 && !IsStopped())//---------
{
a=a+1;
}
double f=a+b;
// составной оператор
return(a+b); // возвращаемое значение
}
We compile it on the 687 build and get Vhod=0 in the debugger.
How do you understand it? At the same time, sometimes I got Vhod=30. (strange but true).
return returns some nonsense...
What are these glitches or am I missing something?