# i want to make TP to break even

hello there i have this 2 moving average cross over Robot .
first cross is sl and 2 cross over will be trade.

how ever i want when the trade open and market move 100 pip the sl should be modify to break even
but when i used orderselect outside the if statement it print the value of OrderOpenPrice() to zero which should be the value of open priced of order .

and 2nd after break even i want to trail the sl according the price of moving average 21.

any suggestion ???

```double initialSl = 0; // global variables
double initialTp = 0; // global variables

void OnTick() {

double FastMovingAverage = iMA(_Symbol,PERIOD_H4, 7,0,MODE_EMA,PRICE_CLOSE,0);
double MidMovingAverage  = iMA(_Symbol,PERIOD_H4,10,0,MODE_EMA,PRICE_CLOSE,0);
double SlowMovingAverage = iMA(_Symbol,PERIOD_H4,21,0,MODE_EMA,PRICE_CLOSE,0);

double LastFastMovingAverage = iMA(_Symbol,PERIOD_H4, 7,0,MODE_EMA,PRICE_CLOSE,1);
double LastMidMovingAverage  = iMA(_Symbol,PERIOD_H4,10,0,MODE_EMA,PRICE_CLOSE,1);
double LastSlowMovingAverage = iMA(_Symbol,PERIOD_H4,21,0,MODE_EMA,PRICE_CLOSE,1);

if((MidMovingAverage>SlowMovingAverage && LastMidMovingAverage<LastSlowMovingAverage) // fast MA upcross
&& OrdersTotal()==0) {

// find the mid MA upcross
double midMA  = MidMovingAverage;
double fastMA = FastMovingAverage;

for(int shift=0; shift<10; shift++) {
double fastMAprev  = iMA(_Symbol,_Period, 7,NULL,MODE_EMA,PRICE_CLOSE,shift+1);
double midMAprev   = iMA(_Symbol,_Period,10,NULL,MODE_EMA,PRICE_CLOSE,shift+1);

if(fastMA>midMA && fastMAprev<=midMAprev) {
// mid MA upcross at shift-th candle
double  stoploss = iLow(_Symbol,PERIOD_H4,shift+1);
break;
}

}

}