Questions from Beginners MQL5 MT5 MetaTrader 5 - page 502

 
jekki:
Good afternoon, could you please tell me how to programmatically write the type of line chart (there is also a bar chart and a candlestick chart - this is understandable), which is necessary for writing the trading conditions?
ChartSetInteger(chart_id,CHART_MODE,CHART_LINE);

where chart_id - chart ID, or 0 - for the current

 

Ah, you can do that too...

double Price_Line_1 = iMA(Symbol(),0,1,0,MODE_SMMA,PRICE_CLOSE,1);

 
jekki:

Ah, you can do that too...

double Price_Line_1 = iMA(Symbol(),0,1,0,MODE_SMMA,PRICE_CLOSE,1);

You can also scratch the right ear with the middle finger of your left foot...

iMA(Symbol(),0,1,0,MODE_SMMA,PRICE_CLOSE,1) equals Close[1] and equals iClose(_Symbol, PERIOD_CURRENT, 1)

 
Hello, could you please tell me how to implement a demo for 1 currency pair and 1 time frame in the indicator
 
Vladimir Fionov:
Hello, could you please tell me how to implement a demo for 1 currency pair and 1 time frame in the indicator
??? Please rephrase your question.
 

Karputov Vladimir:
??? Перефразируйте свой вопрос, пожалуйста. 

The indicator should only work on 1 currency pair and on a certain timeframe of this currency pair
 
Vladimir Fionov:
Hello, could you please tell me how to implement a demo for 1 currency pair and 1 timeframe in the indicator

https://docs.mql4.com/ru/check/isdemo

and manually prescribe the currency pair and timeframe, if they do not match then exit the start.

if(!IsDemo)  return(-1);
if(Symbol() != "EURUSD")  return(-1);
if(Period() != "PERIOD_H1")  return(-1);

like this.

IsDemo - Документация на MQL4
  • docs.mql4.com
IsDemo - Документация на MQL4
 
Vladimir Fionov:
The indicator should work only on 1 currency pair and on a certain timeframe of this currency pair
Indicator will work exactly on that instrument, on which you have attached it and on that timeframe, which is set for the chart.
 
Thank you
 
Vladimir Zubov:

https://docs.mql4.com/ru/check/isdemo

and manually prescribe the currency pair and timeframe, if they do not match then exit the start.

like this.

For the currency pair, if you put a limit all works, but for some reason by timeframe does not work, even if you put it on h1 indicator does not work
Reason: