The following code moved stoploss to breakeven. It sets a global variable in doing so, then to remember that stoploss has moved to breakeven on that particular trade. [...]
save to a file, and read again if need, why need global variable?
global variables are used for exchange a little something between two EA.
and Ticket1 not have init values, and in GloVariableName(i); i means index of GloVariable number not OrdersTotal(),
GloVariable means a pair of name and value, GlobalVariableSet( Ticket1[i], OrderTicket()); value is OderTicket(), What is Ticket1[i] ? no content in it !
for (i = 0 ; i < OrdersTotal() ; i++)
{
Ticket1[i]=GlobalVariableName(i);
save to a file, and read again if need, why need global variable?
global variables are used for exchange a little something between two EA.
and Ticket1 not have init values, and in GloVariableName(i); i means index of GloVariable number not OrdersTotal(),
GloVariable means a pair of name and value, GlobalVariableSet( Ticket1[i], OrderTicket()); value is OderTicket(), What is Ticket1[i] ? no content in it !
for (i = 0 ; i < OrdersTotal() ; i++)
{
Ticket1[i]=GlobalVariableName(i);
Basically i need to save the information one way or another. Can you modifiy my code to save to a file. Or point me in the direction so i can do it myself. I have limited coding experience.

- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
The following code moved stoploss to breakeven. It sets a global variable in doing so, then to remember that stoploss has moved to breakeven on that particular trade.
The code works when i have only one trade open, it will store the global variable and all functions work as they should in my ea. But when i have more that one order open the global variables only work for one trade. If one variable is stored for eg. trade (a) and then another variable is stored for trade (b). The variable for (b) replaces Variable (a). Its seems that one keeps replacing the other...
What i need is;
For a global variable to be stored PER each individual trade as stoploss is moved to breakeven.
To be able to trade multiple currencies at the same time and multiple positions at the same time, long and short and for the variables to be unique to each trade.
I WILL APPRECIATE THE HELP FOR ANYONE WILLING TO GIVE ME A HAND WITH THIS.
HERE IS THE CODE I HAVE SO FAR THAT WORKS WHEN THERE IS ONE POSITION OPEN ON ONE CURRENCY PAIR.