Problem entries at fibo levels.

 

Im having issues with my ea entering at fibo levels. I want the ea to open at each fibo level once. And when there are new fibo levels higher or lower it should again enter at all fibo levels once. I tought i could do this with order comment but i dont get it right. It open at 23.6 and then create a <Deleted> load of orders at the other levels.

      //23.6% fibonacci level
      if ((Close[1] > fibRetraceLevel1 || Close[2] > fibRetraceLevel1) && Low[0] <= fibRetraceLevel1) {
         if (fibRetraceLevel1 != lastOrderComment) {
            ticket = OrderSend(Symbol(), OP_BUY, lastBuyLot * multiplier, Ask, slippage, 0, 0, fibRetraceLevel1, magicNumber, 0, CLR_NONE);
         }
      }
         
      //38.2% fibonacci level 
      if ((Close[1] > fibRetraceLevel2 || Close[2] > fibRetraceLevel2) && Low[0] <= fibRetraceLevel2) {
         if (fibRetraceLevel2 != lastOrderComment && fibRetraceLevel1 == lastOrderComment) {
            ticket = OrderSend(Symbol(), OP_BUY, lastBuyLot * multiplier, Ask, slippage, 0, 0, fibRetraceLevel2, magicNumber, 0, CLR_NONE);
         }
        
      }
      
      //50% fibonacci level
      if ((Close[1] > fibRetraceLevel3 || Close[2] > fibRetraceLevel3) && Low[0] <= fibRetraceLevel3) {
         if (fibRetraceLevel3 != lastOrderComment) {
            ticket = OrderSend(Symbol(), OP_BUY, lastBuyLot * multiplier, Ask, slippage, 0, 0, fibRetraceLevel3, magicNumber, 0, CLR_NONE);
         }
      }
      
      //61.8% fibonacci level
      if ((Close[1] > fibRetraceLevel4 || Close[2] > fibRetraceLevel4) && Low[0] <= fibRetraceLevel4) {
         if (fibRetraceLevel4 != lastOrderComment) {
            ticket = OrderSend(Symbol(), OP_BUY, lastBuyLot * multiplier, Ask, slippage, 0, 0, fibRetraceLevel4, magicNumber, 0, CLR_NONE);
         }
      }
      
      //100% fibonacci level 
      if ((Close[1] > fibRetraceLevel5 || Close[2] > fibRetraceLevel5) && Low[0] <= fibRetraceLevel5) {
         if (fibRetraceLevel5 != lastOrderComment) {
            ticket = OrderSend(Symbol(), OP_BUY, lastBuyLot * multiplier, Ask, slippage, 0, 0, fibRetraceLevel5, magicNumber, 0, CLR_NONE);
         }
      }
 

I think that this is supposed to be MQL4 language.

I will move your topic to the MQL4 and Metatrader 4 section.

Do not use vulgar language in your posts or you will be banned.