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

 

r772ra

Yes! The compiler passed without any errors.

Respect!

 
lottamer:


can you teach me how to refer to history?

is this how to get the last ticket out of there?


Just like with non-history, only in the OrderSelect(int index, int select, int pool=MODE_TRADES) function put MOD E_HISTORY instead of MODE_TRADES and use OrdersTotal() instead of OrdersHistoryTotal().
 
is there a MODULE concept in the code ? so that -2 and 2 equals 2 ?
 

Another theoretical question.

Variables declared in the Expert Advisor have zero value. Suppose that the Expert Advisor has been working for a week, the variables have changed their value, and now I need to make changes in its code. I make changes, recompile, start trading. My question is: What values will be set for global variables? Are they zero, or are they the same as they were before the compilation?

 
lottamer:
is there a MODULAR concept in the code ? so that -2 and 2 equals 2 ?


Yes, but not in the code, but in the mathematical functions,

double MathAbs( double value)

The function returns the absolute value (modulo value) of the number passed to it

Parameters:

value - Numeric value.

 
rigonich:

exactly the same as for non-history, only in function OrderSelect(int index, int select, int pool=MODE_TRADES)you put MODE_HISTORY instead ofMODE_TRADES


yes that's how this point is well known to me...

Please write a piece with last week's ticket request from history...and I'll use it to catch the logic...

 
xant:

Another theoretical question.

Variables declared in the Expert Advisor have zero value. Suppose that the Expert Advisor has been working for a week, the variables have changed their value, and now I need to make changes in its code. I make changes, recompile, start trading. My question is: What values will be set for global variables? Are they zero, or are they the same as they were before the compilation?


If you use functions - those that were before compilation. To change their value, go to the service tab in the terminal.there in the global variables tab and manually change the values of the variables to what you need (0)
 

rigonich

Great! Finally got what I needed!

Thanks to all, even Taras! )))

 
Another question. In which folder are the values of global variables stored? If I, for example, move the terminal to another computer, then in order not to copy the whole thing every time, I will need to reset the file with global variables so that the other terminal picks up their values.
 

MISTIC!!!

this one

-----------------------------------------------------------------------------


pp_sell=(-(PriceOpenLastClosePos()-PriceCloseLastPos())*100000); // for currencies with EUR dimension


Print (pp_sell);

------------------------------------------------------------------------------------

Prints -10, as it should be, since the last SELL trade has a profit of 10

but if you insert several DIFFICULT TIMES BETWEEN PRINT AND VARIABLE, e.g.

----------------------------------------------------------------------------


pp_sell=(-(PriceOpenLastClosePos()-PriceCloseLastPos())*100000); // for currencies with EUR dimension


if ( Hour()>=10 && Hour()<20)

{

if ( Stoch_1>Stoch_2) return(0);

else {

if(OrdersTotal()==0)

{ PlaySound("ok.wav");

if ( GetTypeLastClosePos()==1) Print (pp_sell);

}

Print("___");

}

}

return(0);

}

------------------------------------------------------------------------------------

it works, but prints -9 !!!!

what's the secret?

Reason: