[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1101
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
Dear MQL4 experts
On metastock I understand If((Ref(H,-1) >Ref(H,0)) AND (Ref(H,-2) < Ref(H,-1) ), Ref( H,-1),PREV); but I'm new to MQL4.
I've never seen meta-stock, and MT4/MT% syntax is almost identical to C/C++.
the tutorial/handbook has examples of if() operator: https: //book.mql4.com/ru/operators/if nothing seems too complicated.
Here is also some information about functions and how to write them yourself: https: //book.mql4.com/ru/operators/function
Error 4109 - trading not allowed. How to fix it?
The server does not let you trade - it must be a holiday, or there is no checkbox in the terminal settings to allow trading. Put it like this (Service - Settings):
I have never seen metastock, and MT4/MT% syntax is almost the same as C/C++
there are examples of if() operator in the tutorial/handbook: https: //book.mql4.com/ru/operators/if
there is also information about functions and how to write them yourself: https: //book.mql4.com/ru/operators/function
I used to be a heavy user of Metastock. Alas, MT4 is simpler and more convenient. True, there are much more indicators in Metastock. But learning MQl eliminates this problem. The more so, even without the language the codobase of MT is not small enough.
But I haven't found a solution with gaps yet. So if anyone is not lazy please send me the code.
//+------------------------------------------------------------------+
//| Support and Resistance |//| Copyright © 2004 Barry Stander |
//| http://myweb.absa.co.za/stander/4meta/ |
//+------------------------------------------------------------------+
#property copyright "Click here: Barry Stander"
#property link "http://myweb.absa.co.za/stander/4meta/"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Blue
//---- buffers
double v1[];
double v2[];
double val1;
double val2;
int i;
int init()
{
IndicatorBuffers(2);
//---- drawing settings
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(0,i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "Resistance");
SetIndexStyle(1,DRAW_ARROW,STYLE_DOT,1,Blue);
SetIndexDrawBegin(1,i-1);
SetIndexBuffer(1,v2);
SetIndexLabel(1, "Support");
return(0);
}
int start()
{
i=Bars;
while(i>=0)
{
val1 = iFractals(NULL, 0, MODE_UPPER,i);
if (val1 > 0)
v1[i]=High[i]+(High[i]-Low[i]);
else
v1[i] = v1[i+1];
val2 = iFractals(NULL, 0, MODE_LOWER,i);
if (val2 > 0)
v2[i]=Low[i];
else
v2[i] = v2[i+1];
i--;
}
return(0);
}
//+------------------------------------------------------------------+
Naturally, it will draw a price line on the chart, as described in the indicator published above
//---- drawing settings
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(0,i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "Resistance")
===================================================
One more question.
Is it possible to show several graphs 2 or 3 with different timeframes in one window? Are there any ready-made solutions or examples ?
Another question.
Is it possible to show several 2 or 3 charts with different timeframes in one window? Are there any ready-made solutions or examples?
time intervals? timeframe?
there are some inconveniences in MT indicators - as coordinates X and Y, the indicators use price and time, the time in its turn is also divided into bars and the specific time indication as datetime type, if the indicator draws using indicator buffers, it will definitely draw by bars, and if the indicator uses graphical objects, then the specified time
if your question is about the number of lines - indicator buffers, then MT4 has a maximum of 8 ones for one indicator, but no one bans the use of several indicators
Hello, may I ask a question, if an indicator can take the values of a bar set by time through external variables?
For example, if you enter the date in external variables - January 6, 2011 at 04h 25m, how it can be done in an indicator, thank you in advance.Hello, can I ask a question, can the indicator take bar values set by time via external variables?
For example, if you enter the date in external variables - 2011, January 6, 04h 25 min, how can you do this in an indicator, thanks in advance.
iBarShift
iTime
you can combine them, like this:
and external variables are a way of exchanging data between different EAs/indicators, I don't see why external variables have anything to do with it
Naturally, it will draw a price line on the chart as described in the indicator published above.
//---- drawing settings
SetIndexArrow(0, 119);
SetIndexArrow(1, 119);
SetIndexStyle(0,DRAW_ARROW,STYLE_DOT,1,Red);
SetIndexDrawBegin(0,i-1);
SetIndexBuffer(0, v1);
SetIndexLabel(0, "Resistance");
===================================================
One more question.
Is it possible to show several graphs 2 or 3 with different timeframes in one window? Are there any ready-made solutions or examples?
You didn't say you wanted a rendering - you said you found such a thing on google. Well, DRAW_ARROW is not a line - it's an arrow (it can also just use a character from the table of allowed characters). The computer is a fool that only understands "There is a signal - No signal" - it needs precise instructions. So here you need to know exactly what you need apart from the found prices.