[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 74

 
Figar0 >> :

What is this design anyway?

Yeah, I already figured it out. I ran it through the test.

>> it's clear that I just removed the indicator value, what's the confusion?

 
1Rakso писал(а) >>

I already figured it out, I ran it through the test.

It's clear that I just removed the indicator value, so what's the confusion?

It's just not clear what it is, how can you answer if you understand what you're asking?

If you don't know what it is, you may use it because you don't know what to compare with Bid. It is correct.

 
anat >> :



Can you please tell me how to insert a condition in this construction if(iSAR(NULL,0,step0,0.1,0)<Close[0]), which means that if, for example, buy positions are opened, then sell positions are not opened until all buy positions are closed. In other words, a cycle of trading, we buy 3 positions, wait until all three are closed. Positions are closed only by Stop Loss or Take Profit. All positions are closed, wait for the signal, get a signal, buy or sell (depending on the signal) 3 positions, etc. The "Useful functions from KimIV" have been studied. You can use functions CountOrders(), ExistOrders(), ExistPositions(). But how do I practically insert them? The construct if((iSAR(NULL,0,step0,0.1,0)>Close[0])&& ExistPositions(NULL,OP_SELL)==false) does not work. I understand that I need to insert a logical variable but how do I do this in practice? I don't understand something.


Read the whole thread. I've found the solution - enclose all code in curly braces and write if (OrdersTotal( ) == 0) before them. Crude, but it works. I would like to use bool variables to open any number of orders, guided by a condition if (OrdersTotal() >=maxOpen) return;
 
anat >> :
I've read whole branch. The solution is as follows - enclose all code inside curly braces and before them write if (OrdersTotal( ) == 0). Crude, but it works. I would like to use bool variables to open any number of orders, based on condition if (OrdersTotal() >=maxOpen) return;

If you want to separate Total_sell and Total_buy, try to use the function

int CalculateCurrentOrders(string symbol) from SimpleMACD

int CalculateCurrentOrders(int Type)// OP_BUY , OP_SELL
  {
   int buys=0;
//----
   for(int i=0; i<OrdersTotal(); i++)
     {
      if(OrderSelect( i, SELECT_BY_POS, MODE_TRADES)==false) break;
      if(OrderSymbol()==Symbol() )
        {
         if(OrderType()== Type)  buys++;
        }
     } return( buys);
  }
 
Please tell me which function returns the closing time of the current candle?
 
Diver-si >> :

It's not strategies, it's just an assumption to check. By the way, why is the EA not making trades? I don't understand why.

>> I don't know. I ran it on the tester and it worked. Maybe you made a mistake with the parameters. Or maybe you did not tick the checkbox to allow the EA to trade. And the time of a major TF is set in minutes! i.e. in the TFUP variable you have to specify not m5 but 5, not m30 but 30, not H1 but 60, etc.

 
gmMarat писал(а) >>
Please, tell me which function returns the time of current candle's close.

What is the closing time of the current candle? The current candle is not yet closed, otherwise it is no longer current, we can assume this time is approximately Time[0]+Period()*60

 
Figar0 >> :

What is the closing time of the current candle? The current candle is not yet closed, otherwise it is no longer current, we can assume this time is approximately Time[0]+Period()*60

Figar0 thanks, that's what I needed

 
How to determine the value of one pip in one lot trading? I was advised to use the formula MarketInfo(Symbol(),MODE_LOTSIZE)*Point, but it is absolutely wrong! It returns 100000$*0.001=100$ for USDJPY, which is in fact one dollar, like for most symbols.
 
Цена 1 пункта для стандартного лота:
 
 double ad.QuotePoint   = MarketInfo ( Symbol () , MODE_POINT     )      ;
double ad.QuoteTick    = MarketInfo ( Symbol () , MODE_TICKSIZE  )      ;
double ad.NominalTick  = MarketInfo ( Symbol () , MODE_TICKVALUE )      ;

double ad.NominalPoint = ad.NominalTick  * ad.QuotePoint / ad.QuoteTick ; // Цена 1 пункта для стандартного лота
Цена 1 пункта для ордера известного размера "ad.OrderSize":

double ad.OrderPoint   = ad.NominalPoint * ad.OrderSize                 ;