## GlobalVariable help....

I'd like to create 2 GlobalVariable so that when my EA restarts it knows to use these two variables if they exist

The first is the value of a currency when an order (the first order) was placed, I call this variable center. It is the center value ie. Bid + Ask / 2 = center

The second is count ...Just a simple count that I increase by one with every new order.....until I close them all and the count is reset to zero.

//================================================== =====

Will this work to check for Global Variables "center" and "count"....and if found write the values to the variables center and count in my EA?

if (GlobalVariableCheck(center))
if (GlobalVariableCheck(count))
{
center = (GlobalVariableGet(center));
count = (GlobalVariableGet(count));
BidStart=1;
}

//================================================== ============

Will this (assuming AskStart and BidStart are zero) write the center value to the GlobalVariable "center"

if(BidStart==0)
{
BidStart=NormalizeDouble((Bid),4);
NormalizeDouble((center),4);
Print(center);
BidStart=1;
Comment(center);
GlobalVariableSet("center",center);

}

//================================================== ===================

Will this write the value of count to GlobalVariable "count"?

tic = -1;

if (count==1)
{
{
Sleep(4000);
RefreshRates();
}

if (tic != -1)
{
count=2;
GlobalVariableSet("count", count);
tic = -1;
}
else
{
return(0);
}

{
Sleep(4000);
RefreshRates();
tic = OrderSend(Symbol(),OP_SELL,LE00, NormalizeDouble((Bid),4),5,Bid+sl0*Point,Bid-tp000*Point,"",255,0,CLR_NONE);

}

return(0);

}

//==============================================

Will this Delete GlobalVariable count and center??

if(OrdersTotal()==0)
{

Closenow=False;

count=1;