Jump to content

wonder833

Members
  • Posts

    67
  • Joined

  • Last visited

Posts posted by wonder833

  1. I think some may be interested to watch the chart when the numbers are -9 or 9, but i think alert function should be based on -10 or 10 as the very first rule of this system is for the high/low of the bar to pierce or touch the high/low BB. I can see that things are now getting easier.. when we receive alert based on the four combinations i have posted, we have already known the first rule and second rule have achieved. (second rule is the stochastic 20 80) The only thing we have to do now is only to wait for the bar to close and analyse if the bar patterns fit in the rule.
  2. I have posted this earlier, but see that benny is asking about the MA and PA. I post again, hope it helps.

     

    1) up Green Arrow, -10 (red) => up green arrow as the PA is above both MA, which the MA are in correct order (fast MA above slow MA), -10 red as it touches lower band which indicates a possible buy.

    2) down green arrow, 10 (red) => down green arrow as the PA is below both MA, which the two MA is in correct down trend, 10 red as it touches upper band which indicates a possible sell

    3) up Red Arrow, 10 (red) => up red arrow as the PA is above both MA, MA is in counter trend (fast MA below slow MA), 10 (red) as it touches upper band which indicates a possible sell.

    4) down Red Arrow, -10 (red) => down red arrow as the PA is below both MA, MA is in counter trend (fast MA above slow MA), -10 as it touches lower band indicates a possible buy.

  3. oh ya.. i got it wrong earlier. got myself confused. Yes, you are right. i restate to check if i'm right.

     

    Possible trade happens when

    1) up Green Arrow, -10 (red) => up green arrow as the PA is above both MA, which the MA are in correct order (fast MA above slow MA), -10 red as it touches lower band which indicates a possible buy.

    2) down green arrow, 10 (red) => down green arrow as the PA is below both MA, which the two MA is in correct down trend, 10 red as it touches upper band which indicates a possible sell

    3) up Red Arrow, 10 (red) => up red arrow as the PA is above both MA, MA is in counter trend (fast MA below slow MA), 10 (red) as it touches upper band which indicates a possible sell.

    4) down Red Arrow, -10 (red) => down red arrow as the PA is below both MA, MA is in counter trend (fast MA above slow MA), -10 as it touches lower band indicates a possible buy.

     

    This is the 4 combinations I think of. am i on the right track?

  4. hey fellow mates, you guys are fast in opening thread. Anyone with Method 311 pls kindly share. I don't know about DonnaForex whether if 'she' is that good. Have no comment about her integrity too. But I do follow the forum quite often. Lots experienced traders are in it too. I think can give Method 311 a go if we have the copy :)
  5. Hi guys, I have found out how to solve the problem. Here's the code. Thanks to Chris for starting to help.

     

     

    [size="1"]int LastTradeOP() //Function that finds the order type of the last trade
    {for(int i=OrdersHistoryTotal()-1;i>=0;i--){
      if(OrderSelect(OrdersHistoryTotal()-1,SELECT_BY_POS,MODE_HISTORY)==true) //Selects the last trade from Account History
      {
         if(OrderType()==OP_BUY)
         {
            return(1); //LastTradeOP()==1 if it was a long trade
         }
         if(OrderType()==OP_SELL)
         {
            return(2); //LastTradeOP()==2 if it was a short trade
         }     
      }
      }
      return(0);  //LastTradeOP()==0 if there are no trades
    }[/size]

     

    And this is to add to long condition

     

    && (LastTradeOP()==2 || LastTradeOP()==0))

     

    Add this to short condition

     

    && (LastTradeOP()==1 || LastTradeOP()==0))
  6. I have tried again in backtest. Still can't solve the problem. It is not the open orders problem, as the EA only open one trade at a time. But, It can't recognize the order type of last closed order in the backtest. Hence, it turns out buy, sell, sell, sell, buy, buy, etc. I wonder if it got something to do with backtest, probably it can't find the last order in backtest history?
  7. Continue with 2nd part. Where I put the code under the long condition and short condition.

     

    //+------------------------------------------------------------------+
      //| Signal End                                                       |
      //+------------------------------------------------------------------+
    
      //Buy
      if (Order == SIGNAL_BUY && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))) && (LastTradeOP()==2 || 0)) {
         if(!IsTrade) {
            //Check free margin
            if (AccountFreeMargin() < (1000 * Lots)) {
               Print("We have no money. Free Margin = ", AccountFreeMargin());
               return(0);
            }
    
            if (UseStopLoss) StopLossLevel = Ask - StopLoss * Point; else StopLossLevel = 0.0;
            if (UseTakeProfit) TakeProfitLevel = Ask + TakeProfit * Point; else TakeProfitLevel = 0.0;
    
            Ticket = OrderSend(Symbol(), OP_BUY, Lots, Ask, Slippage, StopLossLevel, TakeProfitLevel, "Buy(#" + MagicNumber + ")", MagicNumber, 0, DodgerBlue);
            if(Ticket > 0) {
               if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
    			Print("BUY order opened : ", OrderOpenPrice());
                   if (SignalMail) SendMail("[signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Ask, Digits) + " Open Buy");
    		} else {
    			Print("Error opening BUY order : ", GetLastError());
    		}
            }
            if (EachTickMode) TickCheck = True;
            if (!EachTickMode) BarCount = Bars;
            return(0);
         }
      }
    
      //Sell
      if (Order == SIGNAL_SELL && ((EachTickMode && !TickCheck) || (!EachTickMode && (Bars != BarCount))) && (LastTradeOP()==1 || 0)) {
         if(!IsTrade) {
            //Check free margin
            if (AccountFreeMargin() < (1000 * Lots)) {
               Print("We have no money. Free Margin = ", AccountFreeMargin());
               return(0);
            }
    
            if (UseStopLoss) StopLossLevel = Bid + StopLoss * Point; else StopLossLevel = 0.0;
            if (UseTakeProfit) TakeProfitLevel = Bid - TakeProfit * Point; else TakeProfitLevel = 0.0;
    
            Ticket = OrderSend(Symbol(), OP_SELL, Lots, Bid, Slippage, StopLossLevel, TakeProfitLevel, "Sell(#" + MagicNumber + ")", MagicNumber, 0, DeepPink);
            if(Ticket > 0) {
               if (OrderSelect(Ticket, SELECT_BY_TICKET, MODE_TRADES)) {
    			Print("SELL order opened : ", OrderOpenPrice());
                   if (SignalMail) SendMail("[signal Alert]", "[" + Symbol() + "] " + DoubleToStr(Bid, Digits) + " Open Sell");
    		} else {
    			Print("Error opening SELL order : ", GetLastError());
    		}
            }
            if (EachTickMode) TickCheck = True;
            if (!EachTickMode) BarCount = Bars;
            return(0);
         }
      }
    
      if (!EachTickMode) BarCount = Bars;
    
      return(0);
    }
    
    //+------------------------------------------------------------------+

×
×
  • Create New...