[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

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
r772ra
Yes! The compiler passed without any errors.
Respect!
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().
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?
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.
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...
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! )))
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?