Questions from Beginners MQL4 MT4 MetaTrader 4 - page 26

 
Renat Akhtyamov:

Right here:

iStochastic(NULL,15,2,3,1,MODE_SMA,0,MODE_SIGNAL,0);

change period (timeframe) to 1,5,15,30,60,240,1440,10080,43200 //M1.M5.M30 ... etc.

or enter Period() instead of 15, then when you switch TF manually, the current one will be automatically set

Thank you very much! i will try it :))
 
TimBerg:
Thank you very much! We will try it :))

It's also better not to look at the zero bar, the value of the indicator "floats" there, so it's quite possible that it crossed the level and then came back and you didn't notice it. So that might be what's causing your problems.

Want a repeatable result - only look at formed bars.

 
TimBerg:
Thank you very much! Let's try it :)))
Advice, if you are trading a crossover then do as above, 1 bar above 15, 2 below.
 

Good afternoon!

Could you please tell me if it is possible to save my current MT4 chart "Save" - "Active chart as is" - but without displaying the lines of my current trades (orders), which I would not like to make light of?

 
Dmitry Romanov:

Good afternoon!

Could you please tell me if it is possible to save my current MT4 chart "Save" - "Active chart as is" - but without displaying the lines of my current trades (orders), which I would not like to light?

\Service/Settings/Charts/"Show trade levels" - uncheck the box
 
Renat Akhtyamov:
\Service/Settings/Charts/Display Trading Levels unchecked
oooh, thanks!!! I've been looking for that for a long time)))
 
The close condition uses a reverse signal, but it does not work yOur trades are only closed at stop or take. What is your reason?
void CloseOpBuySell()
{
  int      ticket=0;
for(int i=0;i<OrdersTotal();i++)
  {
  if(OrderSelect(i,SELECT_BY_POS,MODE_TRADES))
   {
    if(OrderSymbol()==Symbol() && OrderMagicNumber()==mn )
    {
      if(OrderType()==OP_BUY)
        {
          if (FMA1<GrossMA1 && FMA2>GrossMA2&&Bid<FMA1-Distanse*GetPoint() )
{
         ticket=OrderClose(OrderTicket(),OrderLots(),Bid,3,LawnGreen);
        }
      if(OrderType()==OP_SELL)
        {
        if (FRMA1>GrossMA1 && FRMA2<GrossMA2  &&  Ask>FRMA1+Distanse*GetPoint()  )
{
         ticket=OrderClose(OrderTicket(),OrderLots(),Ask,3,LawnGreen);
        }
     }
    }
   }
  }
  }
  }
 
Movlat Baghiyev:
The close condition uses a reverse signal, but it doesn't work yOur trades are only closed at stop or take. What do you think is the reason?

Let's try at the very beginning of the code, at the very top, to write this

#property strict

and compile it.

Will there be any warnings from the compiler?

 

Moved:

Dmitry Melnichenko, 2016.12.07 12:52

Hello, such a question:

how to add an indicator to a chart in mql4, something like ChartIndicatorAdd from mql5?

 
Vladimir Karputov:

Moved:

Dmitry Melnichenko, 2016.12.07 12:52

Hello, such a question:

how to add an indicator to a chart in mql4, something like ChartIndicatorAdd from mql5?

to rewrite the code on mql4

but now i advise you not to do it, and to use 5p

Reason: