ChartGetInteger возвращает значение форматаlong или bool . Через (int) происходит перевод ChartGetInteger в значение int.
если int bars, значит и значение должно быть int при присваивании.
1 . Непосредственно возвращает значение свойства.
longChartGetInteger (
long chart_id, // идентификатор графика int prop_id, // идентификатор свойства int sub_window= 0// номер подокна, если требуется
);
2 . Возвращает true или false в зависимости от успешности выполнения функции. В случае успеха значение свойства помещается в приемную переменную, передаваемую по ссылке последним параметром
boolChartGetInteger (
long chart_id, // идентификатор графика int prop_id, // идентификатор свойства int sub_window, // номер подокна long & long_var // сюда примем значение свойства
);
Lütfen bana MT4 ve MT5 uzmanının kodunu söyleyin, ne koyardı? kaybı durdurmak Mumun yüksek/düşük seviyesinin 2-3 pip üzerinde az önce kapandı.
Veya bu konuyla ilgili eğitimleri nerede görebilirim. Şimdiden teşekkürler :-)
MqlRates türünde bir dizi bildirirsiniz. OHLC ve diğer kapalı mum parametrelerini kopyalayın
intCopyRates (
string symbol_name, // имя символаENUM_TIMEFRAMES timeframe, // периодint start_pos, // откуда начнем (начнём с 1)int count, // сколько копируем (надо всего 1)MqlRates rates_array[] // массив, куда будут скопированы данные
);
ve sonra 2-3 puan saptığınız Yüksek veya Düşük değerleri alır ve orada durursunuz.
WindUP : Teşekkürler, ancak en az bir nesnel örnek verebilirsiniz. Üstten görünüm tabiri caizse. Ve sonra tamamen acemiyim ve konuda olduğu gibi 2 gün :-)
Burada da öğrenmeye çalışıyorum - bir şeyler yolunda gidiyor gibi görünüyor
//+------------------------------------------------------------------+//| CopyRates.mq5 |//| Copyright 2021, MetaQuotes Ltd. |//| https://www.mql5.com |//+------------------------------------------------------------------+#property copyright"Copyright 2021, MetaQuotes Ltd."#property link"https://www.mql5.com"#property version"1.00"#property script_show_inputs//---sinputint Inpcopiedrates = 2 ; // какой барsinputdouble Inphigh = 100 ; // отступить от high//---datetime m_right_time = 0 ,m_left_Ctime = 0 ;
//+------------------------------------------------------------------+//| Script program start function |//+------------------------------------------------------------------+voidOnStart ()
{
//---MqlRates rates[];
ArraySetAsSeries (rates, true );
int copied= CopyRates ( Symbol (), 0 , 0 ,Inpcopiedrates,rates);
if (copied> 0 )
{
Print ( "Скопировано баров: " +copied);
string format= "open = %G, high = %G, low = %G, close = %G, volume = %d" ;
string out;
int size= fmin (copied, 10 );
for ( int i= 0 ; i<size; i++)
{
out=i+ ":" + TimeToString (rates[i].time);
out=out+ " " + StringFormat (format,
rates[i].open,
rates[i].high,
rates[i].low,
rates[i].close,
rates[i].tick_volume);
Print (out);
ObjectDelete ( 0 , "CopyRateshigh" );
m_left_Ctime=rates[i].time;
m_right_time= TimeCurrent ();
TrendCreate( 0 , "CopyRateshigh" , clrBlue , STYLE_DASHDOTDOT , 1 );
TrendPointChange( 0 , "CopyRateshigh" , 0 ,m_left_Ctime,rates[i].high+Inphigh/ 100 );
TrendPointChange( 0 , "CopyRateshigh" , 1 ,m_right_time,rates[i].high+Inphigh/ 100 );
}
}
elsePrint ( "Не удалось получить исторические данные по символу " , Symbol ());
}
//+------------------------------------------------------------------+//| Create a trend line by the given coordinates |//+------------------------------------------------------------------+bool TrendCreate( constlong chart_ID= 0 , // chart's IDconststring name= "TrendLine" , // line nameconstcolor clr= clrRed , // line colorconstENUM_LINE_STYLE style= STYLE_SOLID , // line styleconstint width= 1 , // line widthconstint sub_window= 0 , // subwindow indexdatetime time1= 0 , // first point timedouble price1= 0 , // first point pricedatetime time2= 0 , // second point timedouble price2= 0 , // second point priceconstbool back= false , // in the backgroundconstbool selection= false , // highlight to moveconstbool ray_left= false , // line's continuation to the leftconstbool ray_right= true , // line's continuation to the rightconstbool hidden= true , // hidden in the object listconstlong z_order= 0 ) // priority for mouse click
{
//--- set anchor points' coordinates if they are not set
ChangeTrendEmptyPoints(time1,price1,time2,price2);
//--- reset the error valueResetLastError ();
//--- create a trend line by the given coordinatesif (! ObjectCreate (chart_ID,name, OBJ_TREND ,sub_window,time1,price1,time2,price2))
{
Print ( __FUNCTION__ ,
": failed to create a trend line! Error code = " , GetLastError ());
return ( false );
}
//--- set line colorObjectSetInteger (chart_ID,name, OBJPROP_COLOR ,clr);
//--- set line display styleObjectSetInteger (chart_ID,name, OBJPROP_STYLE ,style);
//--- set line widthObjectSetInteger (chart_ID,name, OBJPROP_WIDTH ,width);
//--- display in the foreground (false) or background (true)ObjectSetInteger (chart_ID,name, OBJPROP_BACK ,back);
//--- enable (true) or disable (false) the mode of moving the line by mouse//--- when creating a graphical object using ObjectCreate function, the object cannot be//--- highlighted and moved by default. Inside this method, selection parameter//--- is true by default making it possible to highlight and move the objectObjectSetInteger (chart_ID,name, OBJPROP_SELECTABLE ,selection);
ObjectSetInteger (chart_ID,name, OBJPROP_SELECTED ,selection);
//--- enable (true) or disable (false) the mode of continuation of the line's display to the leftObjectSetInteger (chart_ID,name, OBJPROP_RAY_LEFT ,ray_left);
//--- enable (true) or disable (false) the mode of continuation of the line's display to the rightObjectSetInteger (chart_ID,name, OBJPROP_RAY_RIGHT ,ray_right);
//--- hide (true) or display (false) graphical object name in the object listObjectSetInteger (chart_ID,name, OBJPROP_HIDDEN ,hidden);
//--- set the priority for receiving the event of a mouse click in the chartObjectSetInteger (chart_ID,name, OBJPROP_ZORDER ,z_order);
//--- set the textObjectSetString (chart_ID,name, OBJPROP_TEXT ,name);
//--- successful executionreturn ( true );
}
//+------------------------------------------------------------------+//| Move trend line anchor point |//+------------------------------------------------------------------+bool TrendPointChange( constlong chart_ID= 0 , // chart's IDconststring name= "TrendLine" , // line nameconstint point_index= 0 , // anchor point indexdatetime time= 0 , // anchor point time coordinatedouble price= 0 ) // anchor point price coordinate
{
//--- if point position is not set, move it to the current bar having Bid priceif (!time)
time= TimeCurrent ();
if (!price)
price= SymbolInfoDouble ( Symbol (), SYMBOL_BID );
//--- reset the error valueResetLastError ();
//--- move trend line's anchor pointif (! ObjectMove (chart_ID,name,point_index,time,price))
{
Print ( __FUNCTION__ ,
": failed to move the anchor point! Error code = " , GetLastError ());
return ( false );
}
//--- successful executionreturn ( true );
}
//+------------------------------------------------------------------+//| Check the values of trend line's anchor points and set default |//| values for empty ones |//+------------------------------------------------------------------+void ChangeTrendEmptyPoints( datetime &time1, double &price1,
datetime &time2, double &price2)
{
//--- if the first point's time is not set, it will be on the current barif (!time1)
time1= TimeCurrent ();
//--- if the first point's price is not set, it will have Bid valueif (!price1)
price1= SymbolInfoDouble ( Symbol (), SYMBOL_BID );
//--- if the second point's time is not set, it is located 9 bars left from the second oneif (!time2)
{
//--- array for receiving the open time of the last 10 barsdatetime temp[ 10 ];
CopyTime ( Symbol (), Period (),time1, 10 ,temp);
//--- set the second point 9 bars left from the first one
time2=temp[ 0 ];
}
//--- if the second point's price is not set, it is equal to the first point's oneif (!price2)
price2=price1;
}
//+------------------------------------------------------------------+
MQL5.com web sitesine giriş yapmak için çerezlerin kullanımına izin vermelisiniz.
Lütfen tarayıcınızda gerekli ayarı etkinleştirin, aksi takdirde giriş yapamazsınız.
Hesabınıza giriş yaptınız. İki faktörlü kimlik doğrulama devre dışı bırakıldı. Yeniden kurup yeni bir QR kodu tarayın veya iki faktörlü kimlik doğrulama devre dışıyken devam edin.
Tünaydın! Lütfen bana parantez içinde ChartGetInteger'ın önünde neden (int) olduğunu söyleyin
int çubuklar=(int)ChartGetInteger(0, CHART_VISIBLE_BARS );
Merhaba. Tavsiye lütfen.
Daha küçük bir zaman diliminin her çubuğuna günün Yüksek ve Düşük çizgilerini çizmesi gereken bir gösterge vardır.
Grafiğe astığımda, sadece günün maksimum ve minimumunun mevcut değerlerine göre çizgiler çiziyor (şekilde olması gerektiği gibi).
Merhaba. Tavsiye lütfen.
Daha küçük bir zaman diliminin her çubuğuna günün Yüksek ve Düşük çizgilerini çizmesi gereken bir gösterge vardır.
Grafiğe astığımda, sadece günün maksimum ve minimumunun mevcut değerlerine göre çizgiler çiziyor (şekilde olması gerektiği gibi).
İşte cevap
İşte cevap
Merhaba, lütfen bana grafiğin kimliğini söyle, nasıl?
Genellikle yardım kazıyorlar.
Lütfen bana MT4 ve MT5 uzmanının kodunu söyleyin, ne koyardı? kaybı durdurmak Mumun yüksek/düşük seviyesinin 2-3 pip üzerinde az önce kapandı.
Veya bu konuyla ilgili eğitimleri nerede görebilirim. Şimdiden teşekkürler :-)
Lütfen bana MT4 ve MT5 uzmanının kodunu söyleyin, ne koyardı? kaybı durdurmak Mumun yüksek/düşük seviyesinin 2-3 pip üzerinde az önce kapandı.
Veya bu konuyla ilgili eğitimleri nerede görebilirim. Şimdiden teşekkürler :-)
MqlRates türünde bir dizi bildirirsiniz. OHLC ve diğer kapalı mum parametrelerini kopyalayın
ve sonra 2-3 puan saptığınız Yüksek veya Düşük değerleri alır ve orada durursunuz.
Ayrıca kullanabilirsin
ve
MqlRates türünde bir dizi bildirirsiniz. OHLC ve diğer kapalı mum parametrelerini kopyalayın
ve sonra 2-3 puan saptığınız Yüksek veya Düşük değerleri alır ve orada durursunuz.
Ayrıca kullanabilirsin
ve
Teşekkürler, ancak en az bir nesnel örnek verebilirsiniz. Üstten görünüm tabiri caizse. Ve sonra tamamen acemiyim ve konuda olduğu gibi 2 gün :-)
Burada da öğrenmeye çalışıyorum - bir şeyler yolunda gidiyor gibi görünüyor