[WARNING CLOSED!] Any newbie question, so as not to clutter up the forum. Professionals, don't go by. Can't go anywhere without you. - page 238

 
Vinin >> :

It is displayed, just off the screen. Do it in a separate window.

>> "in a separate window" - how?

 
splxgf >> :

This is a programming forum, not an elliotchiska forum... maybe you should go to http://elliottwave.ru/

This forum discusses trading strategies and Elliott wave trading

is also a strategy, isn't it?

 
dmmikl86 писал(а) >>

"in a separate window" - how?

#property indicator_separate_window
 
dmmikl86 >> :

>> "in a separate window" - how?

You can't put a horse on the same cart

A horse and a trembling doe. (с)

Your indicator inevitably falls apart, even if it is displayed in a separate window. It's very inconvenient to show 1.5 for GPPUSD and 145.0 for GBPJPY on the same chart without any special tricks.

 

Good evening! I am trying to create my own EA... I made it similar to another EA for MA crossing and back crossing...

But did it with its own parameters ... It opens positions only in one direction and does not even close them...

How do I add a function here that closes when a line is crossed back...

All in all, maestra help!:-(

....

When the blue line is crossed up it bought and when it crosses down it closes.

When crossing the red line upwards sell and when crossing downwards close.

As you can see in the picture, this system does not work...

Help with the code a bit...please!


extern double Lots               = 0.1;
double Points;
int init ()
  {
   Points = MarketInfo (Symbol(), MODE_POINT);
   return(0);
  }
int CalculateCurrentOrders(string symbol)
  {
   int buys=0, sells=0;
   for(int i=0; i<OrdersTotal(); i++)
     {
      if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)==false) break;
      if(OrderSymbol()==Symbol() && OrderMagicNumber()== MAGICMA)
        {
         if(OrderType()==OP_BUY)  buys++;
         if(OrderType()==OP_SELL) sells++;
        }
     }
   if( buys>0) return( buys);
   else       return(- sells);
  }
double LotsOptimized()
  {
   double lot= Lots;
   int    orders= HistoryTotal();  
   int    losses=0;                 
   lot=NormalizeDouble(AccountFreeMargin()*0.02/1000.0,1);
   if(3>0)
     {
      for(int i= orders-1; i>=0; i--)
        {
         if(OrderSelect( i, SELECT_BY_POS, MODE_HISTORY)==false) { Print("Error in history!"); break; }
         if(OrderSymbol()!=Symbol() || OrderType()>OP_SELL) continue;
         //----
         if(OrderProfit()>0) break;
         if(OrderProfit()<0) losses++;
        }
      if( losses>1) lot=NormalizeDouble( lot- lot* losses/3,1);
     }
   if( lot<0.1) lot=0.1;
   return( lot);
  }
void CheckForOpen()
  {
double apglav1;
double apglav2;
double apsig1;
double apsig2;
int    res;
   if(Volume[0]>1) return;
   apglav1 =iCustom(NULL,0,"Caska",0,1); // первая линия на 1м баре
   apsig1 =iCustom(NULL,0,"Caska",1,1); // вторая линия на 1м баре   
   apglav2 =iCustom(NULL,0,"Caska",0,2); // первая линия на 2м баре
   apsig2 =iCustom(NULL,0,"Caska",1,2); // вторая линия на 2м баре
     if ( apglav2< apsig2 && apglav1> apsig1)
     {
      res=OrderSend(Symbol(),OP_BUY, LotsOptimized(),Ask,3,"", MAGICMA,0,Blue);
      return;
     }
     if ( apglav2> apsig2 && apglav1< apsig1)
     {
      res=OrderSend(Symbol(),OP_SELL, LotsOptimized(),Bid,3,"", MAGICMA,0,Red);
      return;
     }
  }
  void CheckForClose()
  {
double apglav1;
double apglav2;
double apsig1;
double apsig2;
   if(Volume[0]>1) return;
   apglav1 =iCustom(NULL,0,"Caska",0,1); // первая линия на 1м баре
   apsig1 =iCustom(NULL,0,"Caska",1,1); // вторая линия на 1м баре   
   apglav2 =iCustom(NULL,0,"Caska",0,2); // первая линия на 2м баре
   apsig2 =iCustom(NULL,0,"Caska",1,2); // вторая линия на 2м бар
   for(int i=0; i<OrdersTotal(); i++)
     {
      if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)==false)        break;
      if(OrderMagicNumber()!= MAGICMA || OrderSymbol()!=Symbol()) continue;
      if(OrderType()==OP_BUY)
        {
        if( apglav2> apsig2 && apglav1< apsig1) OrderClose(OrderTicket(),OrderLots(),Bid,3,White);
        break;
        }
   if(OrderType()==OP_SELL)
        {
        if( apglav2< apsig2 && apglav1> apsig1) OrderClose(OrderTicket(),OrderLots(),Ask,3,White);
        break;
        }
}
}
void start()
  {
   if(Bars<100 || IsTradeAllowed()==false) return;
   if( CalculateCurrentOrders(Symbol())==0) CheckForOpen();
   else                                    CheckForClose();
  }
 

Ellioters are always on the forums where they talk about trading. Create a thread and ask a question. And you can ask the question here. Maybe I'll answer it or someone else will.

 
DDFedor >> :

late... timer started... >> "wave analysis

Sabluk is going to get this thread banned too.

 
Ibiss >> :

When crossing the blue line upwards buy and when crossing downwards close.

When crossing the red line upwards sell and when crossing downwards close.

As you can see in the picture, this system does not work.

Help with code a little...please!


It seems to be all right. (just a glimpse).

Only. This expression

if(Volume[0]>1) return;

you'd better remove it. "This" only works correctly in the tester. And it won't work almost anywhere online!

Better to do a proper job on the Opening Price.

 

Dear forum users!

I wrote an indicator and there is a problem, the moving average (Buf_2) is not drawn, here is the code:

#property indicator_separate_window
#property indicator_buffers 2
#property indicator_color1 Lime
#property indicator_color2 Red

extern int average=14;
//---- buffers
double Buf_1[], Buf_2[];


//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0, Buf_1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1, Buf_2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    i, 
          Counted_bars=IndicatorCounted();


//----
//====================================================================
// график тела с объемом
double sum_b=0.0;
i=Bars- Counted_bars-1;           // Индекс первого непосчитанного
   while( i>=0) 
      {  
       //----
       if (Close[ i]>Open[ i]) {
         sum_b = sum_b + (Close[ i]-Open[ i])*Volume[ i];
         Buf_1[ i]= sum_b;
         }
         
       if (Close[ i]<Open[ i]) {
         sum_b = sum_b - (Open[ i]-Close[ i])*Volume[ i];
         Buf_1[ i]= sum_b;
         }
         
       if (NormalizeDouble(Close[ i],Digits)==NormalizeDouble(Open[ i],Digits)) {
         Buf_1[ i] = Buf_1[ i-1];
         }
         
       i--;
       //----
      }
//====================================================================
// average
int n=0;
   while( i>=0) 
      {  
       //----
       while( n<= average){
         Buf_2[ i]= Buf_1[ i- n];
         n++;
         }
       
       i--;
       //----
      }

//----
   return(0);
  }
//+------------------------------------------------------------------+
Help me understand what the problem is?
 

Urain писал(а) >>

Sabluk's gonna get this branch banned, too.

Yeah, cool.

2 Oper. In short, in order to trade purely on waves, you need to have a brain with the performance of a computer. Exactly the brain with such performance. In other words this may be a case of a one-month chart (with all consequences on B1 at least). It is only in a month that a beginner may calculate all possible scenarios, taking into account the entire history that should also be available, preferably since the beginning of trading of the instrument. Or, as an alternative, the answer to the question - how do you know what the second wave looks like (you asked)? ANY reversal begins with the FIRST wave. A correction to the first is the second. Take M15, on it you will see in detail the beginning of the movement, the correction to it (the first and second waves - the PATTERN) if you do it a hundred times (consider the reversal), then the answer to your question is ready. The only thing to take into account is that the market often draws the pattern without any continuation, that is, if you have seen such a PATTERN, in reality, but not on the history, it can be considered true, only after the trend develops in the same direction, often the pattern breaks. In general, you have to have a lot of conditions to trade on waves.

Personally, I do not possess a part of these features.

1. I am not very smart.

2. A lot of time to master a very complicated subject.

3. Quotes from the beginning of the trading instrument.

Abstract thinking.

4. It is necessary to keep the Whole wave pattern at least for a year in mind (that is where one needs a brain) and not just keep it, but with variants. There are very many variants, as well as the types of correction. It is like optimization of parameters - you added one parameter and two values, you have twice more variants, and if you add five parameters and if you add 1000 values?

Well, we do not have enough brains for that. And not enough time. And not enough quotes.

And there are a lot of other things. It is much easier to use classical TA. It works no worse than VA, although personally I always use Wave Analysis since I spent so much time on it. But MOST traders do very well without BA.

Reason: