Questions from a "dummy" - page 260

 
zfs:
How do I get the time of bar zero?

Add this:

Print(time[0]);
 
DC2008:

Add this:

Dates 1970. This design too.

datetime Time[1];
CopyTime(_Symbol,_PERIOD_,0,1,Time);
 
zfs:

It gives 1970. This design too.

that's not going to give 1970

int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
//---
   ArraySetAsSeries(time,true);
   Print(time[0]);
//--- return value of prev_calculated for next call
   return(rates_total);
  }
 
DC2008:

will not let 1970 go like this

rates_total is at the end
 
zfs:

This construction too.

you have to go like this.

   datetime Time[1];
   CopyTime(NULL,0,0,1,Time);
   Print(Time[0]);
 
DC2008:

it has to be like this

It's the same, but it's still 1970. Not lying, taking out 2 times, just confused).
 
zfs:
It's the same, but it's still 1970. Not lying, outputting 2 times, just got confused).

copy the whole code.

#property indicator_chart_window
int OnInit()
  {
   return(INIT_SUCCEEDED);
  }
int OnCalculate(const int rates_total,
                const int prev_calculated,
                const datetime &time[],
                const double &open[],
                const double &high[],
                const double &low[],
                const double &close[],
                const long &tick_volume[],
                const long &volume[],
                const int &spread[])
  {
   ArraySetAsSeries(time,true);
   Print(time[0]);
   datetime Time[1];
   CopyTime(NULL,0,0,1,Time);
   Print(Time[0]);
   return(rates_total);
  }

it works for me!

 
DC2008:

copy the whole code.

It works for me!

Yes, yes, sorry and thanks, I have the output of several variables and one line is blank, so I got confused)
 
profit1=profit1+"\n";
Is it possible to transfer the line to a new line, it gives 0.
 
zfs:
Is it possible to transfer the line to a new line, so it gives 0.

swap the lines:

   profit1="\n"+profit1;
Reason: