Creating an EA

 

Hello I'm crating a new EA but i have some questions, first is that everithing betweeen int start{ "PROGRAM" return(0)}

will run all the program every Meta tarder Update? so when in metatrader its a 1 pip chane the program automatically run?

- Another question is that if every time that program run again i lost all the defined variables in the previously run?

- My las question is that i want to change all the stop loss automatically to the same stop loss, is ok this?

"if (cambiar_sl) // cambiar_sl= bool that is TRUE if i want to change StopLoss.
{
cambiar_sl=false;
for(i=0; i<OrdersTotal(); i++)
{
OrderSelect(i,SELECT_BY_POS,MODE_TRADES);
OrderModify(OrderTicket(),OrderOpenPrice(),StopLoss,0,0,Yellow);
}//FIN CICLO
}


I have more question but i think this is ok for now :)