ho iniziato a pendere il codice mql4, e mi sono imbattuto in questo codice:
Codice inserito/*/* my_DailyOpen_indior/*/* Revisione 1.1 2005/11/13 Midnite/* Iniziale DailyOpen indior/* basato pm/* #property copyright Midnite #property link [email protected] # proprietà indior_chart_window #property indior_buffers 1 #property indior_color1 DodgerBlue #property indior_style1 2 #property indior_width1 1 double TodayOpenBuffer # 91; # 93 ;; extern int TimeZoneOfData = 0;/ ----------------------------------------------- ------------------- /| Funzione di inizializzazione dell'indiorità personalizzata |/ ----------------------------------------------- ------------------- int init () {SetIndexStyle (0, DRAW_LINE); SetIndexBuffer (0, TodayOpenBuffer); SetIndexLabel (0, Open); SetIndexEmptyValue (0,0.0); ritorno (0); }/ ---------------------------------------------- -------------------- /| Funzione di deinitializzazione dell'indumento di custodia |/ ----------------------------------------------- ------------------- int deinit () {return (0); }/ ---------------------------------------------- -------------------- /| Funzione di iterazione personalizzata dell'indiorità |/ ----------------------------------------------- ------------------- int start () {int lastbar; int counted_bars = IndiorCounted (); if (counted_barsgt; 0) counted_bars--; lastbar = Bars-counted_bars; DailyOpen (0, lastbar); ritorno (0); }/ ---------------------------------------------- -------------------- /| |/ ----------------------------------------------- ------------------- int DailyOpen (int offset, int lastbar) {int shift; int tzdiffsec = TimeZoneOfData * 3600; double barsper30 = 1.0 * PERIOD_M30Period ();/lt; lt; lt; lt; lt; lt; lt; lt; lt; lt; lt; lt; lt; lt; ----- ------ questa riga non mi è chiara ------- bool ShowDailyOpenLevel = True;/lastbar = barsperday 2;/assicurati di ch il daily open lastbar = MathMin (Bars-20 * barsper30-1, lastbar);/lt; lt; lt; lt; lt; lt; lt; lt; lt; ---- --- this this anche not clear ------- for (shift = lastbar; shiftgt; = offset; shift -) {TodayOpenBuffer # 91; shift # 93; = 0; if (ShowDailyOpenLevel) {if (TimeDay (Time # 91; shift # 93; -tzdiffsec)! = TimeDay (Ora # 91; shift 1 # 93; -tzdiffsec)) {//giorno cambia TodayOpenBuffer # 91; shift # 93 ; = Open # 91; shift # 93 ;; TodayOpenBuffer # 91; shift 1 # 93; = 0;/evita le scale nella riga} else {TodayOpenBuffer # 91; shift # 93; = TodayOpenBuffer # 91; shift 1 # 93 ;; }}} return (0); }
può spiegare questo 2 righe di codice che cosa stanno facendo e come funzionano?
Grazie in anticipo.