[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 1122

 
sergeev:

If you just want a number of minutes, you have absolutely no reason to use TimeToStr

Time is a normal int number.

Or alternatively - use TimeToStr only with flag TIME_MINUTE


No, it still doesn't work, it just returns 03:00, but it doesn't take a day into account, so I guess it's not possible to get what I had in mind. Too bad mcl language seems to be simple but does not give great features, I will go and learn java.

extern datetime Time_1     = D'2011.01.12 13:30'; 
extern datetime Time_2     = D'2011.01.05 10:30'; 

datetime me_2     = D'1970.01.01 00:00'; 

bool   Commentari      = true;

int start()
  {

if (Commentari){
 Comment(
         "\n Дата  =  " + TimeToStr(Time_1-Time_2,TIME_MINUTES)," минут",
      
         "\n==============================");}
   return(0);
  }

Thank you all for your patience.

A special thanks to you Alexey, it was a pleasure doing business with you. )

Regards Eliza.

 
The platform, hidden in the autorun, expands to full screen when the computer is switched on, can its action be made hidden, invisible?
 

Good afternoon, all,

There is a problem with arrays:

Let's say

int start (){ // function start

int OrdSen_1=OrderSend(Symbol(), OP_BUY, 0.10, Ask ,1, Ask-70*Point, Ask+70*Point); // Order to buy
if(OrdSen_1==-1){ Alert("OrdSen_1 ",GetLastError());} // Checking order placing error

double mas1[]={}; // Array
}

The question is how to place the values "Symbol(), OP_BUY, 0.10, Ask,1, Ask-70*Point, Ask+70*Point" that belong to OrdSen_1 into the array mas1[]={} so that they can be further used, taken from the array or equate these values with variables for their further use. There may be more such orders, as well as arrays. The main thing is to understand the principle.

VERY grateful for help and explanations, preferably in detail :)

 

I start to write a function in an empty template

int start()
  {
//----
      int NOO(int a) {
      }
//----
   return(0);
  }

and there is an error

'(' - function definition unexpected
I.e. the function was bigger, this is what's left - the error doesn't go away.
 
Dimka-novitsek:
The platform, hidden in the autorun, expands to the full screen when you turn on the computer, but is it possible to make its action hidden, invisible?

"It's not a straightforward task.

You could do it this way.

Or here is more

cmd или bat файл:

start "" /min "c:\Program Files\Mozilla Firefox\firefox.exe"
 
Abzasc:

I start to write a function in an empty template

and there is an error

I.e. the function was bigger, this is what's left - the error doesn't go away.

The function should be written outside of start()
 

Guys, please help, there's a formula in here but I can't figure out what it is.

int init()
{
return(0);
}

int deinit()
{
double AngleIndex=0;
string AngleName=";


for(AngleIndex=0;AngleIndex<=720;AngleIndex=AngleIndex+22.5)
{
AngleName = "Angle_" + AngleIndex;
ObjectDelete(AngleName + "Label");
ObjectDelete(AngleName + " Line");
}


return(0);
}

int start()
{
double AngleIndex=0;
string AngleName=";
double FactorIndex=0;
double AnglePriceLevel=0;
int Index=0;
string strLabel=";

for(AngleIndex=0;AngleIndex<=720;AngleIndex=AngleIndex+22.5)
{
AnglePriceLevel = CalculateSquare(FactorIndex,StartPrice);

//Trim Zero's
if(Index==1)
{
strLabel = DoubleToStr(AngleIndex,1);
}
else
{
strLabel = DoubleToStr(AngleIndex,0);
}

AngleName = "Angle_" + AngleIndex;



if(ObjectFind(AngleName + "Line") != 0)
{
ObjectCreate(AngleName + " Line", OBJ_HLINE, 0, Time[40], AnglePriceLevel);
//ObjectSet(AngleName + " Line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
ObjectSet(AngleName + " Line", OBJPROP_BACK, true);

if(MathMod(Index,2) == 0)
{
ObjectSet(AngleName + " Line", OBJPROP_COLOR, _45Degree_Color);
ObjectSet(AngleName + " Line", OBJPROP_STYLE, STYLE_DASH);
}
else
{
ObjectSet(AngleName + " Line", OBJPROP_COLOR, _22.5Degree_Color); //25.5
ObjectSet(AngleName + " Line", OBJPROP_STYLE, STYLE_DASHDOTDOT);
}
}
else
{
ObjectMove(AngleName + " Line", 0, Time[40], AnglePriceLevel);
}

if(ObjectFind(AngleName + " Label") != 0)
{
ObjectCreate(AngleName + " Label", OBJ_TEXT, 0, Time[20], AnglePriceLevel);

if(MathMod(Index,2) == 0)
{
ObjectSetText(AngleName + " Label", strLabel + "°", 12, "Verdana", _45Degree_Color);

}
else
{
ObjectSetText(AngleName + " Label", strLabel + "°", 12, "Verdana", EMPTY);
}

}
else
{
ObjectMove(AngleName + " Label", 0, Time[20], AnglePriceLevel);
}

FactorIndex = FactorIndex + 0.56;// 0.125 <<<<<<<<<<< Renier gebruik 0.14
Index = Index + 1;
}

return(0);
}






double CalculateSquare(double Factor, double Price)
{
double AnglePrice=0;

if(Price > 0)
{

if(StringFind(Symbol(), "JPY",0) == -1)
{
Price = Price * 100000;
}
else
{
Price = Price * 1000;
}

if(Direction_Up==true)
{
AnglePrice = MathPow(MathSqrt(Price) + Factor,2);
}
else
{
AnglePrice = MathPow(MathSqrt(Price) - Factor,2);
}

if(StringFind(Symbol(), "JPY",0) == -1)
{
AnglePrice = AnglePrice / 100000;
}
else
{
AnglePrice = AnglePrice / 1000;
}

}

return(AnglePrice);

}


I just want to write the formula in Excel for ease of calculation, thank you in advance

 
artmedia70:
A function must be written outside start()

How's that?

If so.

int start()
  {
//----

//----
   return(0);
  }
  int My_function (int a, bool b=true, int c=1, double d=0.5)
   {
   return(0);
   }

then

Function "My_function" is not referenced and will be removed from exp-file      

Although, with the bracket, the error is gone... And then, if it's out of bounds, then you can't nest functions?

I'm slow on the spot...

 
Abzasc:

How's that?

If so.

then

Although, with the bracket, the error is gone... And then, if it's out of bounds, then you can't nest functions?

I'm slow on the spot...

Have you tried to translate warning from English into Russian?

Translate it before you ask any more questions. I think you'll understand why this warning appears after you translate it into Russian.

And what, for you, is the concept of nested functions?

 
artmedia70:

Have you tried translating the warning from English into Russian?

Translate it before you ask any more questions. I think you will understand why this warning appears after you translate it into Russian.

Mm-hmm. Got it. What I don't get. Outside will be deleted because it's not referenced, inside won't work because.

I'd like a sample, huh?