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
I can't find my way around, where in the Reference does it say that in exchange execution a request should not contain TP/SL?
I don't remember that in the reference. But as far as I know it is true. It is more correct to say SL/TP as far as I understand on the exchange you have to put separate orders (having a certain type and specification).
In principle you can look at stock terminals like exactly, grey box or say in Quik
PS
This for example may be related to the law. As far as I know the US law requires stops to be marked in a certain way (and not otherwise).
For their wrong execution certain penalties are imposed. i can not say for sure, but those who traded on the NYSE (or similar exchanges) i think they should know exactly what and how.
Please tell me how to take the values of all iBands.
https://www.mql5.com/ru/articles/31
there is something useful here, but the editor didn't find it when compiling
"#include <GetIndicatorBuffers.mqh>"
Please tell me how to take the values of all iBands.
https://www.mql5.com/ru/articles/31
there is something useful here, but at compilation the editor didn't find
"#include <GetIndicatorBuffers.mqh>"
Please advise where to place the file uploaded by the Expert Advisor. I tried it in MQL5/Files. The tester gives error 5004. The indicator finds the same file in MQL5/Files right away. What is error 5004?
Please read more:
A file with .txt extension. The request is like this
int filehandle=FileOpen(fname,FILE_READ|FILE_ANSI,"\n");
if(filehandle!=INVALID_HANDLE) Print("FileOpen: ",FileSize(filehandle)," bytes");
else Print("Operation FileOpen failed, error ",GetLastError());
The error is
2012.05.09 21:14:14 Core 01 2011.01.01 00:00:00 Operation FileOpen failed, error 5004
The file is located in the MQL5/Files folder. Checked it 1000 times. And the tool loads it without any problems.
Build 642.
Please advise where to place the file uploaded by the Expert Advisor. I tried it in MQL5/Files. The tester gives error 5004.
The file located in the shared folder can be accessed both from the terminal and the tester.
The public folder can be opened from MetaEditor - File - Open public data folder.
The file located in the shared folder can be accessed both from the terminal and the tester.
The public folder can be opened from MetaEditor - File - Open public data folder.
There's no way it worked through the tester sandbox.
Hello!
Can you please tell me what to do to make the minute charts draw a vertical line at the right hour. My attempts are going nowhere:
//Vertical lines at a certain time
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_plots 1
//+----------------------------------------------+
//| Image rendering parameters |
//+----------------------------------------------+
//---- indicator line drawing
#property indicator_type1 DRAW_HISTOGRAM
#property indicator_color1 blue
#property indicator_width1 1
#property indicator_label1 "Time-line"
#define RESET 0 // constant for returning the command to the terminal to recalculate the indicator
//+----------------------------------------------+
//| Indicator input parameters |
//+----------------------------------------------+
input intHour1=10; //time 1
//+----------------------------------------------+
int StartBars;
bool GoodTime;
//---- declaration of dynamic arrays, which will be
//---- be further used as indicator buffers
double TimeDataBuffer[]; //
//+------------------------------------------------------------------+
//| class for working with date|
//+------------------------------------------------------------------+
class MyDateClass
{
private:
int m_year; // year
int m_month; // month
int m_day; // day of month
int m_hour; // hour in a day
int m_minute; // minutes
int m_second; //seconds
public:
//--- default constructor
MyDateClass(void);
};
//+------------------------------------------------------------------+
//| default constructor|
//+------------------------------------------------------------------+
MyDateClass::MyDateClass(void)
{
MqlDateTime dt;
datetime DT=TimeCurrent(dt);
TimeToStruct(DT,dt);
m_hour=dt.hour;
m_minute=dt.min;
m_second=dt.sec;
if (m_hour==Hour1 && m_minute==0) GoodTime=true;
DT=StructToTime(dt);
Print(DT);
}
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int OnInit()
{
//---- initialisation of global variables for the indicator marks
StartBars=7;
//----
SetIndexBuffer(0,TimeDataBuffer,INDICATOR_DATA);
ArraySetAsSeries(TimeDataBuffer,true);
//---
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int OnCalculate(const int rates_total,
const int prev_calculated,
const datetime &time[],
const double &open[],
const double &high[],
const double &low[],
const double &close[],
const long &tick_volume[],
const long &volume[],
const int &spread[])
{
//---- check for sufficiency of bars for calculation
if(rates_total<StartBars) return(RESET);
int limit,bar; //
//---- calculation of the required number of copied data
//---- and start number limit for the bar_calculated cycle
if(prev_calculated>rates_total || prev_calculated<=0)//check for the first start of the indicator calculation
limit=rates_total-StartBars; // start number for the calculation of all the bars
else limit=rates_total-prev_calculated; // start number for calculating new bars
//---
//---- main indicator calculation cycle
for(bar=0; bar<limit; bar++)
{
TimeDataBuffer[bar]=0.0;
if (GoodTime==true) TimeDataBuffer[bar]=2.0;
}
//--- return value of prev_calculated for next call
//---
return(rates_total);
}
Here is the code for the vertical line: