retesere20

el-tt-prnt

May 27th, 2018 (edited)
130
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. {
  2. <<< Performance-Friendly debug window, by TazoTodua#gmail.com >>>
  3.  
  4. ::::::::: USAGE :::::::::::
  5. In indicator, insert this in host-script:
  6.  
  7. vars: string text_to_formlog("");
  8. Method void PrintCL(string a1) begin
  9. text_to_formlog = a1;
  10. Value1 = tt_formlog(text_to_formlog);
  11. end;
  12.  
  13. Then, in the execution start:
  14.  
  15. Once value1= tt_formLog("reset");
  16.  
  17. Then insert printouts anywhere:
  18.  
  19. PrintCL("hellooo");
  20. PrintCL(Close.ToString());
  21.  
  22.  
  23. Then on chart click CTRL+MouseClick and you will see log window.
  24. }
  25.  
  26. using elsystem;
  27. using elsystem.collections;
  28. Using charting;
  29. Using platform;
  30. using elsystem.windows.forms;
  31.  
  32. Inputs:
  33. object passed_object(objectSimple);
  34.  
  35. vars:
  36. GlobalDictionary thisChart_formLogs(null),
  37.  
  38. int i_(0),
  39. int y_ (0)
  40. ;
  41.  
  42. var: string passed_text("");
  43. vars:
  44. ChartingHost ChartingHost1( NULL );
  45.  
  46.  
  47. // ================ for initialization of form ======================//
  48. method void AnalysisTechnique_Initialized( elsystem.Object sender, elsystem.InitializedEventArgs args )
  49. begin
  50. Print("init");
  51. Print(passed_text);
  52. // AVOID MULTIPLE INITIALIZATIONS ! ! !
  53. If ( passed_text="reset") then begin // ChartingHost1 = Null and
  54. Print("rst");
  55. InitChartingHost();
  56. end;
  57. end;
  58. //
  59.  
  60. method void InitChartingHost()
  61. begin
  62. chartinghost1 = new ChartingHost;
  63.  
  64. chartinghost1.Name = "chartinghost1";
  65. thisChart_formLogs= null;
  66. chartinghost1.chartelementclick += chartinghost1_chartelementclick;
  67. end;
  68.  
  69.  
  70. {
  71. method void tableCreate(string keyMember) begin
  72. TableLayoutPanel1.RowStyles.Clear();
  73. TableLayoutPanel1.ColumnStyles.Clear();
  74. // int allWords = gs.punctuations.Count();
  75. TableLayoutPanel1.RowCount = 4;
  76. // TableLayoutPanel2.ColumnCount = 1;
  77. // float eachSize = 20 / 100; // tableLayoutPanel1.Height / allWords;
  78.  
  79. tableLayoutPanel1.ColumnStyles.Add( new ColumnStyle( SizeType.Percent, 100) );
  80.  
  81. i_ = 0;
  82. //For y_ = 0 to formLogs[keyMember].count-1 begin
  83. tableLayoutPanel1.RowStyles.Add( new RowStyle(20, 100));
  84. // formLogs[formLogs.Keys[y_].ToString()] astype string
  85. tableLayoutPanel1.Controls.Add( Label.Create( "ss", 20, 100 ), 0, y_);
  86. //end;
  87. //tableLayoutPanel1.CellBorderStyle = TableLayoutPanelCellBorderStyle.Single;
  88. end;
  89. }
  90.  
  91.  
  92. method void ChartingHost1_ChartElementClick( elsystem.Object sender, charting.ChartElementClickEventArgs args )
  93. vars:
  94. BarVisualElement barElement, string finalTxt;
  95. begin
  96. // barnumber[0] ----> LastBarNumber
  97. //args.time -------> 25-May-18 8:00:00 PM
  98. finalTxt="";
  99. if (not Form1.Visible) and args.IsKeyDown[Key.control] then Form1.Show();
  100.  
  101. If Form1.Visible then begin
  102. //if clicked onto bar
  103. try
  104. if(args.Element <> null) then begin
  105. barElement = args.Element astype BarVisualElement ;
  106. finalTxt = "-----barElement.BarsAgo" + barElement.BarsAgo.ToString();
  107. end;
  108. //PrintCL( (barnumber[0]-barElement.BarsAgo).ToString() + " - BarNumber");
  109. //AppStorage["DebugBar"] = (barnumber[0]-barElement.BarsAgo) astype int;
  110. // AppStorage["DebugDate"] <> null and bardatetime = AppStorage["DebugDate"] astype DateTime; //DateTime.Parse("1/1/1")
  111. catch (exception ex)
  112. //AppStorage["DebugBar"] = 0 astype int;
  113. end;
  114.  
  115. //tableCreate(args.time.ToString());
  116. if(thisChart_formLogs.Contains(args.time.ToString())) then begin
  117. TextBox1.Text = thisChart_formLogs[args.time.ToString()].ToString();
  118. end
  119. Else begin
  120. TextBox1.Text = "";
  121. end;
  122. end;
  123. end;
  124. // ======= init ======== //
  125.  
  126. print(SO_Clock_wMS + " : obj_conversion START");
  127.  
  128. If passed_object istype string then passed_text = passed_object.ToString()
  129. Else if
  130. passed_object istype double or
  131. passed_object istype int or
  132. passed_object istype bool
  133. then
  134. passed_text = passed_object.ToString()
  135. Else
  136. passed_text = passed_object.ToString();
  137.  
  138.  
  139. print(SO_Clock_wMS.ToString() + " : Word: " + passed_text.ToString());
  140.  
  141. print(SO_Clock_wMS + " : obj_conversion END");
  142.  
  143.  
  144. vars: added_ (""), string barDt("");
  145.  
  146. Form1.TopMost = true;
  147. barDt = bardatetime.ToString();
  148.  
  149.  
  150. If (passed_text = "reset") then begin
  151. Once begin
  152. print(SO_Clock_wMS + " : RESET + DictCreate START !!!!!!!");
  153. thisChart_formLogs= null;
  154. thisChart_formLogs = GlobalDictionary.Create(false, tt_chartname );
  155. print(SO_Clock_wMS + " : RESET + DictCreate END");
  156. end;
  157. end
  158. Else begin
  159. Once begin
  160. print(SO_Clock_wMS + " : DictCreate START !!!!!!!");
  161. thisChart_formLogs = GlobalDictionary.Create(false, tt_chartname );
  162. print(SO_Clock_wMS + " : DictCreate END");
  163. end;
  164.  
  165. added_ = "";
  166. if ( thisChart_formLogs.Contains( barDt ) ) then begin
  167. print(SO_Clock_wMS + " : added START");
  168. added_ = thisChart_formLogs[barDt].ToString() + NewLine;
  169. print(SO_Clock_wMS + " : added END");
  170. end;
  171.  
  172. print(SO_Clock_wMS + " : arrayMember START ");
  173. thisChart_formLogs[barDt] = added_ + passed_text;
  174. print(SO_Clock_wMS + " : arrayMember END");
  175. end;
  176.  
  177. tt_print=0;
RAW Paste Data