Download MetaTrader 5
To add comments, please log in or register
Have you found a good programmer? Make a targeted order!
Wei Sun
699
Wei Sun 2014.04.12 08:29 

/+------------------------------------------------------------------+
//|                                                         test.mq5 |
//|                        Copyright 2013, MetaQuotes Software Corp. |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright "Copyright 2013, MetaQuotes Software Corp."
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   if(ChartSetInteger(0,CHART_FIRST_VISIBLE_BAR,1000))
     Print(ChartGetInteger(0,CHART_FIRST_VISIBLE_BAR));
     else
       Print("ERROR");

  }
//+------------------------------------------------------------------+

It should print out 1000,but not ,why? 
自动交易和策略测试
自动交易和策略测试
  • www.mql5.com
MQL5:MetaTrader 5客户端内置的交易策略语言。语言允许编写您自己的自动交易系统,技术指标,脚本和函数程序库
Alain Verleyen
Moderator
30639
Alain Verleyen 2014.04.12 08:43  
bcsunwww:


It should print out 1000,but not ,why? 

See documentation, you can't set this property, it's read-only :

CHART_FIRST_VISIBLE_BAR

Number of the first visible bar in the chart. Indexing of bars is the same as for timeseries.

int r/o

Wei Sun
699
Wei Sun 2014.04.12 17:20  
angevoyageur:

See documentation, you can't set this property, it's read-only :

CHART_FIRST_VISIBLE_BAR

Number of the first visible bar in the chart. Indexing of bars is the same as for timeseries.

int r/o

Thank you very much.
/
To add comments, please log in or register