Someone scribble a script for 5 wmz. - page 17

 

Weird thing, has anyone encountered this problem: when you first start the installed terminal and connect the EA online it trades, but as soon as you reopen the MT4 terminal, the EA stops trading.

The situation is stupid, every time I have to look for terminals of new brokerage companies and keep the terminal open for several days, using "switch to sleep mode" when I shut down the computer, and testing the Expert Advisors by changing basic Moving Average and MACD Sample codes in the editor. The operating system is Win2000 SP4.

And the main question is whether it is possible to teach the Expert Advisor to consider the Pound and Euro forecasts. For example the forecast of Yen nnv=yen, the Expert Advisor performs a buy deal, but the forecasts of GBP with EUR in B show more of a downtrend and it would be correct to perform a sell deal.

if ( DayOfWeek()==3){//если сегодня четверг
if ( Hour() == 23)  {//если - 22 часа терминального времени
if ( NumberOfPositions("USDJPY" ,OP_BUY, Magic )==0 ) { //если  нет о
  if ( Close[1]>=Open[24] && Close[23]<=Open[48] && Close[47]<=Open[72]) { 
        //покупаем 
      SL=0;TP=0;
      if(StopLoss>0 && StopLoss>StopLevel )    SL=Bid-Point*StopLoss;
      if(TakeProfit>0 && TakeProfit>StopLevel) TP=Bid+Point*TakeProfit;
      if(StopLoss  <StopLevel && StopLoss>0)   SL = Bid-Point*StopLevel; 
      if(TakeProfit<StopLevel && TakeProfit>0) TP = Bid+Point*StopLevel; 
   ticket=WHCOrderSend("USDJPY",OP_BUY,lotsi,Ask,3,SL,TP,"Regulest_JPY",Magic,0,clOpenBuy );
   if(ticket < 0) {
            Print("Ошибка открытия ордера SELL #", GetLastError()); 
            Sleep(10000);  prevtime = Time[1];   return (0); 
                  } 

        }}}} 

//  при ННВ он проводит сделку BUY, но если GBP и EUR сегодня ВВВ, то нужна SELL сделка
if ( Close[1]>=Open[24] && Close[23]>=Open[48] && Close[47]>=Open[72])
if ( Close[1]>=Open[24] && Close[23]>=Open[48] && Close[47]>=Open[72])

if the GBP and EUR today are BBB, then SELL trade is needed.

 
Profitabl:

Strange thing, has anyone encountered this problem: when you first start the installed terminal and connect the EA online it trades, but as soon as you reopen the MT4 terminal, the EA stops trading.

The situation is stupid, every time I have to look for terminals of new brokerage companies and keep the terminal open for several days, using "switch to sleep mode" when I shut down the computer, and testing the Expert Advisors by changing basic Moving Average and MACD Sample codes in the editor. The operating system is Win2000 SP4.

And the main question is whether it is possible to teach the Expert Advisor to consider the Pound and Euro forecasts. For example the forecast of Yen nnv=yen, the Expert Advisor performs a buy deal, but the forecasts of GBP with EUR in B show more of a downtrend and it would be correct to perform a sell deal.

if the GBP and EUR are in BBB today it would need a SELL trade


The problem is in the terminal settings

 
Profitabl:

The situation is stupid, every time I have to search for terminals of new brokerage companies and keep the terminal open for several days at a time, using the "switch to sleep mode" when the computer is off, and the Expert Advisors are tested by replacing the basic Moving Average and MACD Sample codes in the editor. The operating system is Win2000 SP4.

When I run out of hard drive space, I will need to buy a couple of new disks... then a couple of new computers.

Take a good look around you, look at your surroundings, especially at all the buttons in the terminal and especially at the F1 key.

The impression is that nowadays to be a fool is normal, even fashionable and cool. If someone doesn't get it just like you, he's a real fool.

ps. when there's no more space in the flat to accommodate new computers... well... we'll have to get a new flat.

 
Profitabl:

Strange thing, has anyone encountered this problem: when you first start the installed terminal and connect the EA online it trades, but as soon as you reopen the MT4 terminal, the EA stops trading.

The situation is stupid, every time I have to search for terminals of new brokerage companies and keep the terminal open for several days, using "switch to sleep mode" when I shut down the computer, and testing the Expert Advisors by replacing the codes of Moving Average and MACD Sample in the editor. The operating system is Win2000 SP4.

And the main question is whether it is possible to teach the Expert Advisor to consider the Pound and Euro forecasts. For example the forecast of Yen nnv=yen, the Expert Advisor performs a buy deal, but the forecasts of GBP with EUR in B show more of a downtrend and it would be correct to perform a sell deal.

if the GBP and EUR today are BBB, then SELL trade is needed.

Service - settings - charts. Set max 2 lower fields, max bars in the history and in the window. The problem is that when you restart the terminal, only the number of bars that is prescribed there will be displayed. Apparently the number you have specified is not enough.
 
Profitabl:

the price is final, a trivial task - that means five minutes. chirp, chirp and the script is written.


do you believe in miracles?
 
if ( DayOfWeek()==5){//если сегодня вечер вторника
if ( Hour() == 0 && Minute()==30)  {//если - 22 часа терминального времени
if ( NumberOfPositions("USDCHF" ,OP_SELL, Magic )==0 ) { //если  нет о
   if ( Close[1]>= Open[48] && Close[49]<=Open[96] && Close[97]<=Open[144]) {//н/ввв=н/н н/ввн=В/В в/ннн=В/н в/ннв=в/В
        //покупаем 
      SL=0;TP=0;
      if(StopLoss>0 && StopLoss>StopLevel )    SL=Ask+Point*StopLoss;
      if(TakeProfit>0 && TakeProfit>StopLevel) TP=Ask-Point*TakeProfit;
      if(StopLoss  <StopLevel && StopLoss>0)   SL = Ask+Point*StopLevel; 
      if(TakeProfit<StopLevel && TakeProfit>0) TP = Ask-Point*StopLevel; 
   ticket=WHCOrderSend("USDCHF",OP_SELL,lotsi,Bid,3,SL,TP,"Regulest_CHF_sl=120=tp",Magic,0,clOpenBuy );
   if(ticket < 0) {
            Print("Ошибка открытия ордера SELL #", GetLastError()); 
            Sleep(10000);  prevtime = Time[1];   return (0); 
                  } 
        }}}} 

Hi all. Who knows how to replace the start time in the conditions with just the 30 Minute chart bars? The problem is that without "&& Minute()==30", just with Hour()==0 eight EAs of a set open eight positions at any time during the first hour from 00.00 to 00.59, and so if ( Hour() == 0 && Minute()==30) for one minute 00.30 positions manage to open 2-3 EAs from eight, they work only one minute. How to make them start like for Hour, during second bar of 30 Minutes from 00.30 to 00.59?

It seems to me the time if ( Hour() == 0 && Minute()== 30) can be conditioned by the number of bar 30M in that day, for example it was the second bar of the first hour, and this if ( Hour() == 0 && Minute()==0) is the first bar of the first hour.

if ( DayOfWeek()==5){/if today is Friday

if ( ????????? ) {// if the second bar is 30Minutes on the chart, which corresponds to the time if ( Hour() == 0 && Minute()==30)

What should be instead of (????????), does anyone know?

 

All thanks, that's the solution.

                if ( DayOfWeek()==5){//  вот так стартует с 18.00 до 18.29
if ( Hour() == 18.00 && Minute()<=29) 

                if ( DayOfWeek()==5){ //  вот так будет стартовать с 18.30 до 18.59
if ( Hour() == 18.00 && Minute() >=30)