Hi All,
I'm in need of some disparate help here

. I've got some code that will look for an agreement between different indicators. Once they all agree I want a way for the trades to enter in the way I described it in the chart images. So far I can enter the 1st "Buy" trade but it doesn't enter just 1 trade....it's entering up to 8 trades. And then, if the market goes against me I enter a "contingency trade" where I'm buy/selling again despite that its going against me.
I would greatly appreciate if someone could show me what the correct code should look like
Not sure if these images will show but just in case I also have them as attachments.
Here is my flawed code that is supposed to execute the trade...
while (execute_trade ==5)
{if ( OrdersTotal() == buy_trade1 ) //buy_trade1 = 1...this stops it after 1 order have been placed...but doesnt work yet
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+ TakeProfit*Point);
execute_trade=0;
if(OrderSelect(ticket, SELECT_BY_TICKET, MODE_TRADES))
Print("My ticket is: " , ticket);
{
buy1 = OrderOpenPrice(); //taking the 1st order's price and pushing it into this variable
// Comment("order #1 open price is ", OrderOpenPrice() + " " + buy1 + " less than " + (buy1-0.0030));
if (buy1 >= (buy1-0.0030))
{
//if ( OrdersTotal() <= buy_trade1 ) //this stops it after 1 order have been placed.
ticket=OrderSend(Symbol(),OP_BUY,Lots,Ask,3,0,Ask+ TakeProfit*Point);
//execute_trade=0;
}
}
else
Print("OrderSelect returned the error of ",GetLastError());
}