[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 916

 

Hello, I have a question. what value does iCustom() return from an indicator?

i.e. i have an indicator which has a calculation that should result in 1 or 0 or -1

and an Expert Advisor in which iCustom() is called.

I don't know where to put the calculated value in the indicator to get it in the Expert Advisor when calling it.

 
naked:

Hello, I have a question. what value does iCustom() return from an indicator?

i.e. i have an indicator which has a calculation that should result in 1 or 0 or -1

and an Expert Advisor in which iCustom() is called.

I don't know where to put the calculated value in the indicator to get it in the Expert Advisor when calling it.

If iCustom() is -1 in the indicator, iCustom() will also give -1 in the Expert Advisor. you do not need to change anything in the indicator.
 
so i don't understand!, should iCustom() be a defined variable or should i put it in return(????), because wherever i put this value iCustom() returns 0.
 
s500:

hello!

Question about strategy tester: When testing in the journal tester no results with the records in the log file, in the terminal log error records also no ..... at the end of the loading bar, in the tester, there is a nasty squeak. advisor lies in the folder experts all the checkboxes are set hundred help plz?

You might not have downloaded the quotes history or configure settings so that the advisor does not make trades
 
naked:
so i don't understand! must a certain variable be set in the indicator or should i write it in return(????), because iCustom() returns 0 regardless of where i put this value.
it depends on the type of the indicator. if the values 1 0 or -1 are stored by the indicator array, you don't need to change anything in the EA. but if the indicator doesn't use a buffer, iCustom() won't help.
 
forex-k got it. no array. no global variables either. I'll fix it. Thank you.
 

Is it true that the EA may be tested but will not work on a demo or real account?

if so, should i recode the whole EA to make it work on the real account?

why should I re-code it for a testing version?

but if it's true, it's totally ...... i don't know how to write!!!!!!! i must have reread

the tutorial 10 times and in the documentation I do not argue all is smart and beautiful, but I still do not understand

what it says in there.!!!!

 
artmedia70:

In the EA, check whether the order is closed on a stop. And if so, change the value of your flag.

You can use Igor Kim's ready-made function to determine if the last closed position was closed by a stop.

Or you can do it yourself. In any case, it would be a good example for you to start with:


I haven't tried to use your function, but I've tried to change flag in other, simpler way.

In the loop, which is much higher than the function of opening orders (it checks further on the code whether it needs to close its orders). Here, OP is a label of an order to be placed (my flag):

for(i=0; i<OrdersTotal(); i++)
{
if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)
{OP=0;
break;// if the order number i does not exist, stop the search
}

....


In theory, if the reason was the value of the flag, the issue should have been closed. But the tester still does not open any further orders after the breakdown of the stop((

One more thing: when testing, the tester generates error 1. Is it worth paying special attention to it?

 
How do I create a function and call it?
 
ViktorF:


I have not tried the function you have given, but I have tried to change the flag in another, simpler way.

In the loop, which is much higher than the function of opening orders (it checks further by code the necessity of closing its orders). Here, OP is a mark of an order to be placed (my flag):

for(i=0; i<OrdersTotal(); i++)
{
if (OrderSelect(i,SELECT_BY_POS,MODE_TRADES)==false)
{OP=0;
break;// if the order number i does not exist, stop the search
}

....


In theory, if the reason was the value of the flag, the issue should have been closed. But the tester still does not open any further orders after the breakdown of the stop((

One more thing: when testing, the tester generates error 1. Is it worth paying special attention to it?

You have a strange design here. You are doing a standard loop of orders of the terminal. From zero to OrdersTotal() -1. And then you check the complete absence of orders in the terminal in the loop. Why don't you check the ticket for orders? Or a magik? And your flag =0 for some reason. And why not false? However, you are the boss. Your logic, you have to understand it. :)
Reason: