Most likely, I do not understand the situation correctly.
Why does it open orders when changing EA parameters?
Or is it a "billet"?
sutrade:
Most likely, I do not understand the situation correctly.
Why does it open orders when changing EA parameters?
Or is it a "billet"?
This Expert Advisor is an example of implementing the TrailingStop function. Not for trading. And it opens POSITIONS after changing the parameters because: after changing the input parameters, the EA is reinitialised - the Init event takes place and the OnInit() function is triggered, in which the "FirstStart" flag is set to true - that is, the EA is set to the "First Start " state:
//+------------------------------------------------------------------+
//| Expert initialisation function|
//+------------------------------------------------------------------+
int OnInit()
{
***
FirstStart=true;
return(INIT_SUCCEEDED);
}
//| Expert initialisation function|
//+------------------------------------------------------------------+
int OnInit()
{
***
FirstStart=true;
return(INIT_SUCCEEDED);
}
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
TrailingStop:
An example of an Expert Advisor with a Trailing Stop implementation.
Author: Vladimir Karputov