I have an EA that i will like to reset its external variables to the default setting within the EA after a trade is taken, can you advise on how to achieve that?
Related to your question, I want to know how to reset initial values when they have reached their trigger point....
Like, I want stuff to happen when BestEquity and WorstEquity points get reached....but to reset these values after they have been reached .....hmmm, what line of code do I need for that?
Sample code below.
Quote
Disliked
int init()
{
//----
StartingEquity = AccountEquity(); ///sets the StartingEquity to be the AccountEquity When trading robot starts
TargetBestEquity = ((StartingEquity*EBHedge)+StartingEquity); //at what target level to balance hedge trading to lock in profit
TargetWorstEquity = (BestEquity-(BestEquity*SLHedge)); //at what level down from BestEquity to set stop loss hedge
//----
return(0);
}