Hi Guys,
Please check this.
I want to buy the next tick as soon as the bar formed has a higher high than the previous bar.
I keep getting an error. Not able to figure out what is wrong here.
Syntax is right. So it compiles.
But I am pretty sure I am wrong with the logic. Somebody please help.
Regards
Brijesh
Please check this.
I want to buy the next tick as soon as the bar formed has a higher high than the previous bar.
PHP Code
int start()
{
int x,ticket,total;
int counted_bars=IndicatorCounted();
Comment("Buy High");
//----
total = OrdersTotal();
if(total < 1)
{
if (High[1] > High[2])
{
ticket=OrderSend(Symbol(),OP_BUY,1,Ask,3,Ask-25*Point,Ask+25*Point,"NULL",12345,0,Green);
if(ticket>0)
{
//if(OrderSelect(ticket,SELECT_BY_TICKET,MODE_TRADES))
Print("BUY order opened : ",OrderOpenPrice());
}
else
Print("Error opening BUY order : ",GetLastError());
return(0);
}
}
//----
return(0);
}
Syntax is right. So it compiles.
But I am pretty sure I am wrong with the logic. Somebody please help.
Regards
Brijesh