[ARCHIVE!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Can't go anywhere without you - 4. - page 295

 

Comrades... Help me with this script...

I need a script that would put pending orders in a grid and be able to set step, stop and takeout parameters. I need a script, not an Expert Advisor. I found a script that meets my needs, set the parameters, put it on a chart but no pending orders appear... Maybe I should adjust something in the terminal?

 
Rustbunch:

Comrades... Help me with this script...

I need a script that would put pending orders in a grid and be able to set step, stop and takeout parameters. I need a script, not an Expert Advisor. I found a script that meets my needs, set the parameters, put it on a chart but no pending orders appear... Maybe I should adjust something in the terminal?

Does it write anything in the logs?
 
Where do I look at the logs?
 
Rustbunch:
Where do you look at the logs?

You have to look at the logs in the logbook.


 

Good afternoon, colleagues. I don't have a lot of knowledge yet, so I hope for your help. I need to build an array of ticks, as I understand there is no tick history, so I have to build it myself:

double BD_IN[]; //array of ticks
datetime BD_TIME[]; //array of time
int BD_SIZE=5; //size
int counter=0; //Counter

int init()

{
ArrayResize(BD_IN,BD_SIZE);
ArrayResize(BD_TIME,BD_SIZE);
ArrayResize(BD_CHAR,BD_SIZE);
counter=0;
return(0);
}

int start()

{
if(counter<BD_SIZE)
{
BD_IN[counter]=Ask;
BD_TIME[counter]=TimeCurrent();
counter++;
}

//All that is written below is needed only for visual check of correctness of
Comment("counter=",counter);
if(counter==BD_SIZE)
{
string str="\n";
for(int i=0;i<BD_SIZE;i++)
{
str=str+"BD_IN["+i+"] ="+BD_IN[i]+" BD_TIME["+i+"] ="+BD_TIME[i]+"\n";
}
Comment(str); //output for visual check
}
return(0);
}

Did I do it right or is there a better way to create the array I need or is there a tick history?

 
Desead:

Good afternoon, colleagues. I don't have a lot of knowledge yet, so I hope for your help. I need to form an array of ticks, as I understand there is no tick history, that's why I have to form it myself:

double BD_IN[]; //array of ticks
datetime BD_TIME[]; //array of time
int BD_SIZE=5; //dimensionality
int counter=0; //counter

int init()

{
ArrayResize(BD_IN,BD_SIZE);
ArrayResize(BD_TIME,BD_SIZE);
ArrayResize(BD_CHAR,BD_SIZE);
counter=0;
return(0);
}

int start()

{
if(counter<BD_SIZE)
{
BD_IN[counter]=Ask;
BD_TIME[counter]=TimeCurrent();
counter++;
}

//The code below is only needed for visual check of correctness
Comment("counter=",counter);
if(counter==BD_SIZE)
{
string str="\n";
for(int i=0;i<BD_SIZE;i++)
{
str=str+"BD_IN["+i+"] ="+BD_IN[i]+" BD_TIME["+i+"] ="+BD_TIME[i]+"\n";
}
Comment(str); //output for visual check
}
return(0);
}

Did I did it right, or is there a better way to create a needed array, or maybe there is a history of ticks?

Assembler.

In fact, for the future, it's this way.

 
Roman.:

Collector.

In general, for future reference, here.

Thanks )
 
ilunga:
does it say anything in the logs?
It says the following. First Script ... loaded successfully, then a second later Script ... removed
 
Rustbunch:
Writes the following. First Script ... loaded successfully, then a second later Script ... removed
Do you send the script to the current chart or test it in the strategy tester?
 
paladin80:
Do you throw the script on the current chart or test it in the strategy tester?
I am throwing it on the current chart