i would like to recall what my last indicator value, example - if the open is less than the MA and the close is above the MA mark it on the chart with the trade open/tp/stop.
i want to change the code to recall where the last trade open was located i thought i could mark it within the loop like
Inserted Code
/*buy*/ if(ma<Close[shift+1] && ma>Open[shift+1])
{
/*open*/ v1[i] = Open[shift];
/*tp*/ v3[i] = Open[shift]+profit;
/*stop*/ v4[i] = Open[shift]-stop;
} Inserted Code
/*buy*/ if(ma<Close[shift+1] && ma>Open[shift+1] && lastOrder<Close[shift+1])
{
/*open*/ v1[i] = Open[shift];
/*tp*/ v3[i] = Open[shift]+profit;
/*stop*/ v4[i] = Open[shift]-stop;
lastOrder = Open[shift];
}