![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
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
Download minute candles (e.g. from Alpari) and do a test on minute candles.
How am I going to do a test on minutes if I have an MTS for H4...?
You can't test on 4hourly candlesticks with 5 pips stop.
In the article Automated Trading Championship 2007: Common Errors in Experts
I have read that OrderSend error 130 (ERR_INVALID_STOPS) is wrong or too close stops.
Called the DC, asked at what minimum distance a stop can be set - they said no such limit... Strange!
I also do not understand one thing. If I manually open an order, I can't actually set stop and profit in it... Then how does OrderSend() do this?
I checked if I manually place an order and then place a stop... A minimum of 4 pips should be set from the open price - i.e., the current price...
Now I have to twist OrderModify(). Why do we need stoploss in OrderSend() then ?
How am I going to do a test on minutes if I have an MTS for H4...?
Why not?The test on the smallest TF is done as follows
You write calls like this (for example)
We will try to use any timeframe and it will be the most efficient and correct test on minutes!
it will be the most correct!
---
Unfortunately, you can't do it on ticks! Because there's no tick history in the MT4 tester
---
Learn to write the TF right away! And then your EA will not care what TF it was run on!
it is reasonable to write parameters instead of constants - for simpler code and clearer perception I put constants
Yuri) I'm not a pro at this...) At least describe what it means to me. wpr[1] = iWPR ( Symbol(), 10, PERIOD_H4, 1 );
Yury) I'm not a pro in this business...) At least describe what it means. wpr[1] = iWPR ( Symbol(), 10, PERIOD_H4, 1 );
iWPR is a built-in indicator
double iWPR( string symbol, int timeframe, int period, int shift)
Larry Williams' Percent Range indicator calculation.
Parameters:
symbol - Symbol name of instrument, on data of which this indicator will be calculated. NULL means current symbol.
timeframe - Period. Can be one of the chart periods. 0 means the period of the current chart.
period - Period (number of bars) to calculate the indicator.
shift - Index of the value received from the indicator buffer (shift relative to the current bar back by a specified number of periods).
Example:
if(iWPR(NULL,0,14,0)>iWPR(NULL,0,14,1)) return(0);
it is described in the FAQ, have a look
wpr[...] is the array where results of each indicator with a different period are summarized
( you can name the array whatever you want)
double wpr[5] ;
wpr[1] = iWPR ( Symbol(), 10, PERIOD_H4, 1 );
wpr[2] = iWPR ( Symbol(), 20, PERIOD_H4, 1 );
wpr[3] = iWPR ( Symbol(), 40, PERIOD_H4, 1 );
wpr[4] = iWPR ( Symbol(), 60, PERIOD_H4, 1 );
I just showed a call with different periods...
The idea was to put a period in indicators so that you could test it on any TF
Decided to do an open order modification...
Right after OrderSend
There is an error in the log:
invalid ticket for OrderModify function
11:43:54 2005.01.26 13:12 EURUSD: OrderModify error 4051
Please advise what is wrong?
The new stop values must be set as follows: :
where the new stop is set - in pips (in whole numbers)Is MarketInfo() used for OrderClose needed for OrderModify?