help coding

 
Hello dear forumers,

I'm a new member in this platform and want some help to code a methedology  in forex trading using the recovery zone trading concept, I wonder how to code an expert advisor based on simple trading rules with this concept, I would like to adopt an EA that work by opening pending orders in specific areas (yesterday high and yesterday low) for example and operats as follows

case 1 : the EA will place the pending orders at the opening of today's trading (0 hour ) without expiration dates.Buy stop  at the high, stop loss  at the low and the take profit at x pips from buystop/sellstop.

case 2 : if the price hits the one of the stops, the EA will place another  pending order in the same area (high and low) with double lot.


case 3: if the price hits one of the take profit, end of the cycle, the EA will close the remaining pending order and wait until a new setup appear means until the new high and low.

I had many EAs based on this methodology and cannot find that suit my need, please help me coding this EA, thank you in advance.


here is my attempt : 


    if (TimeHour(TimeCurrent()) == OrdersPlacementTime && TimeMinute(TimeCurrent()) == 0)

     {

/**/

        if (= true) 

        {

            if (nb_total == 0 && data_counter(5) == 0) 

            { 

                set_tunnel();



                if (use_pending_setup && pending_total == 0) 

                {

                    set_short(SHORT_IN,SHORT_SL, SHORT_TP);

                    set_long(LONG_IN,LONG_SL, LONG_TP);

                }

            }

         }

           

        }

 

       if (OrderType() == OP_BUY  && pending_total == 0)

         {

            set_short(LONG_SL, SHORT_SL, SHORT_TP);

         }

         else if (OrderType() == OP_SELL && pending_total == 0)

         {

            set_long(SHORT_SL,LONG_SL, LONG_TP);

         }

/* 

  if ((data_counter(3)) >= SHORT_TP) 

        {

             DeletePendingOrder();set_tunnel();

        }

        if ((data_counter(3)) >= LONG_TP) 

        {

            DeletePendingOrder();set_tunnel();

        }

*/ 

       

CheckOrders();



/*        

        if (nb_longs != 0 && Bid <= SHORT_IN) 

        {

            close_long();

            SELL();

        }

        if (nb_shorts != 0 && Ask >= LONG_IN) 

        {

            close_short();

            BUY();

        }



        if (pending_total == 1) 

        {

            cancel_long();

            cancel_short();

        }

*/

//---

        if (enable_trail == true) 

        {

            trail();

        }





        if (= true) current_bar = Bars;

    }