LIP/Arch/RU/LIP_v01.002/Include/LIP_Fun3_5_v1.002.mqh

155 lines
18 KiB
MQL5
Raw Permalink Normal View History

2025-05-30 15:03:51 +02:00
<EFBFBD><EFBFBD>//============================================================================================= MQL5 ===
// LibreInfoPDO Function3_5 v1.002 MQL5
// @0D8:0, 2K2>4 =0 G0@B 8 ?@5>1@07>20=8O 2K2>40
// Librecoin (c)2014-2017
//======================================================================================================
#property strict
//============================================================================================= MQL5 ===
// INCLUDE - ?>4:;NG05<K5 <>4C;8
//------------------------------------------------------------------------------------------------------
//----- 1@0B=K5 AAK;:8 =0 >A=>2=>9 D09; ?@>5:B0
#include "LIP_Ref_5_v1.002.mqh"
//============================================================================================= MQL5 ===
// ColoLabelCreate() - !>740=85 :>;>=B8BC;0 (703>;>2:0 :>;>=:8)
// E>4:
// iGName - 8<O 3@0D >1J5:B0
// iShift - A4283 ?> 3>@87>=B0;8
// iColoText - B5:AB <5B:8 :>;>=:8
//------------------------------------------------------------------------------------------------------
void ColoLabelCreate(string iGName,
int iShift,
string iColoText){
//-----
string isTXW=iGName+"_C";
CopyTime(TheSymbol,PERIOD_CURRENT,(nFirstBar-(int)((iShift+ColoShift+120)*kScale)),1,gTime);
{if(ObjectCreate(
0, //45=B8D8:0B>@ G0@B0 - "5:CI89 3@0D8:
isTXW, //<O 3@0D8G5A:>3> >1J5:B0
OBJ_TEXT, //"8? 3@0D8G5A:>3> >1J5:B0
nSubWindow, //><5@ ?>4>:=0
gTime[0], //>>@48=0B0 ?> 2@5<5=8
IndHeigh //>>@48=0B0 ?> F5=5
)
)
{
ObjectSetString(0,isTXW,OBJPROP_TEXT,iColoText); //K2>48<K9 B5:AB
ObjectSetString(0,isTXW,OBJPROP_FONT,"Arial"); //#AB0=>28< H@8DB B5:AB0
ObjectSetInteger(0,isTXW,OBJPROP_FONTSIZE,8); //#AB0=>28< @07<5@ H@8DB0
ObjectSetDouble(0,isTXW,OBJPROP_ANGLE,0.0); //#AB0=>28< C3>; =0:;>=0 B5:AB0
ObjectSetInteger(0,isTXW,OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);//#AB0=>28< A?>A>1 ?@82O7:8
ObjectSetInteger(0,isTXW,OBJPROP_COLOR,clrAqua); //#AB0=>28< F25B
ObjectSetInteger(0,isTXW,OBJPROP_BACK,false); //B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5
ObjectSetInteger(0,isTXW,OBJPROP_SELECTABLE,false); //:;NG8< (true) 8;8 >B:;NG8< (false) @568< ?5@5<5I5=8O >1J5:B0 <KHLN
ObjectSetInteger(0,isTXW,OBJPROP_SELECTED,false); //B:;NG8< 2K1@0==>ABL
ObjectSetInteger(0,isTXW,OBJPROP_HIDDEN,false); //!:@>5< (true) 8;8 >B>1@078< (false) 8<O 3@0D8G5A:>3> >1J5:B0 2 A?8A:5 >1J5:B>2
ObjectSetInteger(0,isTXW,OBJPROP_ZORDER,0); //#AB0=>28< ?@8>@8B5B =0 ?>;CG5=85 A>1KB8O =060B8O <KH8 =0 3@0D8:5
}}//if(!ObjectCreate(...
}//ColoLabelCreate()
//
//============================================================================================= MQL5 ===
// ColoCreate() - !>740=85 :>;>=:8
// E>4:
// iGName - 8<O 3@0D >1J5:B0
// iShift - A4283 ?> 3>@87>=B0;8
// nTotal - :>;8G5AB2> >1J5:B>2
//------------------------------------------------------------------------------------------------------
void ColoCreate( string iGName,
int iShift,
int nTotal){
//-----
string isTXW="";
CopyTime(TheSymbol,PERIOD_CURRENT,(nFirstBar-(int)((iShift+ColoShift)*kScale)),1,gTime);
{for(int i=0;i<=nTotal-1;i++)
{
isTXW=iGName+"_"+IntegerToString(i); //#AB0=02;8205< 8<O 4;O B5:AB>2>3> >1J5:B0
//!>740=85 (?5@5A>740=85) >1J5:B0, ?>78F8O ?@82O7:8
ResetLastError();
{if(!ObjectCreate(
0, //45=B8D8:0B>@ G0@B0 - "5:CI89 3@0D8:
isTXW, //<O 3@0D8G5A:>3> >1J5:B0
OBJ_TEXT, //"8? 3@0D8G5A:>3> >1J5:B0
nSubWindow, //><5@ ?>4>:=0
gTime[0], //>>@48=0B0 ?> 2@5<5=8
IndHeigh-11.0*(i+1) //>>@48=0B0 ?> F5=5
)
)
{
Print("ObjectCreate0 Error=",GetLastError());
continue;
}}//if(!ObjectCreate(...
ObjectSetString(0,isTXW,OBJPROP_TEXT," "); //K2>48<K9 B5:AB
ObjectSetString(0,isTXW,OBJPROP_FONT,"Arial"); //#AB0=>28< H@8DB B5:AB0
ObjectSetInteger(0,isTXW,OBJPROP_FONTSIZE,8); //#AB0=>28< @07<5@ H@8DB0
ObjectSetDouble(0,isTXW,OBJPROP_ANGLE,0.0); //#AB0=>28< C3>; =0:;>=0 B5:AB0
ObjectSetInteger(0,isTXW,OBJPROP_ANCHOR,ANCHOR_LEFT_UPPER);//#AB0=>28< A?>A>1 ?@82O7:8
ObjectSetInteger(0,isTXW,OBJPROP_COLOR,clrAqua); //#AB0=>28< F25B
ObjectSetInteger(0,isTXW,OBJPROP_BACK,false); //B>1@078< =0 ?5@54=5< (false) 8;8 704=5< (true) ?;0=5
ObjectSetInteger(0,isTXW,OBJPROP_SELECTABLE,false); //:;NG8< (true) 8;8 >B:;NG8< (false) @568< ?5@5<5I5=8O >1J5:B0 <KHLN
ObjectSetInteger(0,isTXW,OBJPROP_SELECTED,false); //B:;NG8< 2K1@0==>ABL
ObjectSetInteger(0,isTXW,OBJPROP_HIDDEN,false); //!:@>5< (true) 8;8 >B>1@078< (false) 8<O 3@0D8G5A:>3> >1J5:B0 2 A?8A:5 >1J5:B>2
ObjectSetInteger(0,isTXW,OBJPROP_ZORDER,0); //#AB0=>28< ?@8>@8B5B =0 ?>;CG5=85 A>1KB8O =060B8O <KH8 =0 3@0D8:5
}}//for(int i=0;i<nOrderList;i++)
}//ColoCreate()
//
//============================================================================================= MQL5 ===
// ColoLabelMove() - 5@5<5I5=85 703>;>2:0 :>;>=:8
// E>4:
// iGName - 8<O 3@0D >1J5:B0
// iShift - A4283 ?> 3>@87>=B0;8
// iColoText - B5:AB <5B:8 :>;>=:8
//------------------------------------------------------------------------------------------------------
void ColoLabelMove( string iGName,
int iShift,
string iColoText){
//-----
string isTXW=iGName+"_C";
CopyTime(TheSymbol,PERIOD_CURRENT,(nFirstBar-(int)((iShift+ColoShift+120)*kScale)),1,gTime);
{if(ObjectSetInteger(
0, //45=B8D8:0B>@ G0@B0 - "5:CI89 3@0D8:
isTXW, //<O 3@0D8G5A:>3> >1J5:B0
OBJPROP_TIME, //7<5=O5< :>>@48=0BC 2@5<5=8 >1J5:B0
gTime[0] //>>@48=0B0 ?> 2@5<5=8
))
{
{if(ObjectSetDouble(
0, //45=B8D8:0B>@ G0@B0
isTXW, //<O >1J5:B0
OBJPROP_PRICE, //7<5=O5< :>>@48=0BC F5=K >1J5:B0
IndHeigh //>>@48=0B0 ?> F5=5
))
{
ObjectSetString(0,isTXW,OBJPROP_TEXT,iColoText);
}}//if(ObjectSetDouble(...
}}//if(ObjectSetInteger(...
}//ColoLabelMove()
//
//============================================================================================= MQL5 ===
// ColoDelete() - #40;5=85 :>;>=:8
// E>4:
// iGName - 8<O 3@0D >1J5:B0
// nTotal - :>;8G5AB2> >1J5:B>2
//------------------------------------------------------------------------------------------------------
void ColoDelete( string iGName,
int nTotal){
//-----
{for(int i=0;i<=nTotal-1;i++)
{
ObjectDelete(0,iGName+"_"+IntegerToString(i)); //#AB0=02;8205< 8<O 3@0D8G5A:>3> >1J5:B0 8 C40;O5< >1J5:B
}}//for(int i=0;i<=nOrderList-1;i++)
}//ColoDelete()
//
//============================================================================================= MQL5 ===
// GraphDelete() - #40;5=85 :>;>=:8
//------------------------------------------------------------------------------------------------------
void GraphDelete(){
//-----
ObjectDelete(0,"LIP_C"); //Position
ObjectDelete(0,"LIO_C"); //Order
ObjectDelete(0,"LHO_C"); //History order
ObjectDelete(0,"LHD_C"); //History deal
ColoDelete("LIP",Positions_Total); //>;>=:0 ?>78F89
ColoDelete("LIO",Orders_Total); //>;>=:0 >@45@>2
ColoDelete("LHO",History_Orders_Total); //>;>=:0 8AB>@88 >@45@>2
ColoDelete("LHD",History_Deals_Total); //>;>=:0 A45;>:
}//GraphDelete()