[ARCHIVE] Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 3. - page 415

 
bool Val_max=true;
bool Cl_dn=true;
bool Val_min=true;
//лучше определиться где правда, а где ложь, ладн, будем считать все семафоры открытыми

void start()
  {
      if(Val_max==true)
         if(условие_1)
         {
           Alert("Значение инд. >= 1.0000 (исп. 1-е усл.)");
           Val_max=false;//считаем что первое условие выполнилось                                       //заглушка
         }
      if(Cl_dn==true && Val_max==false) //тут тоже более менее нормуль, второе условие проверяется если отметилось первое
         if(условие_2)
         {
           Alert("1 бар закрылся падением (исп. 2-е усл.)");
           Cl_dn=false;                                         //заглушка
         }
      if(Val_min==true && Val_max==false && Cl_dn==false)//третье будет проверяться только после наступления первых двух
         if(условие_3)
         {
           Alert("Значение инд. <= 0.9980 (исп. 3-е усл.)");
           Val_min=false;                                       //заглушка
         }
      if(Val_max!=true && Cl_dn!=true && Val_min!=true)
         {
           //здесь будет посылаться жирный ордер
           Val_max=true;
           Cl_dn=true;
           Val_min=true;      
         }   
//----
   return(0);
  }
What exactly is the problem? too lazy to run it and check how it will work?
 
igid:
So you have to run several terminals at the same time and log in with different logins in each?

Yes. Each terminal has its own trading account.
 
nadya:
Can you please tell me how to divide all orders into two groups when each order is opened so that I can see which group each order belongs to later on? (MAGIC will not work)

When opening an order of this or that group, you should decide for yourself - put a comment to the order in one group, not in the other one. Then you will analyze whether the order has a comment, and if so, it will belong to the first group, and if there is no comment, then it will belong to the second one.
 

Friends, I tried to write a primitive expert, but I got a snag!

There's no way my logic can get to it...

If anyone can help, the parameters are as follows:

Sequence of actions:

1.Check if there are any open and pending orders.

(if there is at least one pending or open-no action;

if there are 0 orders - step 2).

2) Open a BuyStop order at 50 pips from the current price, SL=50, TP=100 for Time=100 minutes.

3. Beginning.

Changeable parameters:

Lots

TakeProfit

StopLoss

TralingStop

Price (number of points away from the current price at which the pending order will be opened)

Time (time of expiration of the pending order)

Please help!

Thanks in advance!

 
OlegArH:

Friends, I tried to write a primitive expert, but I got a snag!

There's no way my logic can get to it...

If anyone can help, the parameters are as follows:

Sequence of actions:

1.Check if there are any open and pending orders.

(if there is at least one pending or open-no action;

if there are 0 orders - step 2).

2) Open a BuyStop order at 50 pips from the current price, SL=50, TP=100 for Time=100 minutes.

3. Beginning.

Changeable parameters:

Lots

TakeProfit

StopLoss

TralingStop

Price (number of points away from the current price at which the pending order will be opened)

Time (time of expiration of the pending order)

Please help!

Thanks in advance!

Have you readthis section of the textbook?
 
Roman.:
Have you read this section of the textbook?

Aha!

But, being far from programming, I just had a myriad of questions and misunderstandings.

It killed all the enthusiasm... (

 
OlegArH:

Aha!

But, being far from programming, I just had a myriad of questions and misunderstandings.

It killed all the enthusiasm... (


In that case, please refer to the appropriate threads of the forum, e.g. here...
 

Can you tell me how to round the rsi to a whole number, and how can I change the period of the rsi (default is 14)?

Thank you

//+------------------------------------------------------------------+
//|                                                  RSI_to_File.mq4 |
//|                      Copyright © 2007, MetaQuotes Software Corp. |
//|                                        http://www.metaquotes.ru/ |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2007, MetaQuotes Software Corp."
#property link      "http://www.metaquotes.ru/"

#property show_inputs
string SymbolsArray[11]={"","USDCHF","GBPUSD","EURUSD","USDJPY","CHFJPY","EURGBP","EURCHF","EURJPY","GBPJPY","GBPCHF"};

//+------------------------------------------------------------------+
//| string SymbolByNumber                                   |
//+------------------------------------------------------------------+
string GetSymbolString(int Number)
  {
//----
   string res="";
   res=SymbolsArray[Number];   
//----
   return(res);
  }

//+------------------------------------------------------------------+
//| возвращает период                                                |
//+------------------------------------------------------------------+
int PeriodNumber(int number)
   {
   int per_min;
   switch (number)
      {
     
      case 5: per_min=PERIOD_H4;break;
      default: per_min=PERIOD_D1;break;
      }
   return(per_min);   
   }

//+------------------------------------------------------------------+
//|   выводит в файл котировки + значения индикатора                 |
//+------------------------------------------------------------------+
void RSI_output(string SymbolName,int PeriodMinutes)
   {
   int size=iBars(SymbolName,PeriodMinutes);
//----
   if (size==0) return;
   int handle=FileOpen(SymbolName+PeriodMinutes+"_RSI.csv",FILE_WRITE|FILE_CSV);
   if (handle<0) return;
   FileWrite(handle,"Time;RSI");
   for (int i=size-1;i>=0;i--)
      {
      FileWrite(handle,TimeToStr(iTime(SymbolName,PeriodMinutes,i))
         ,iCustom(SymbolName,PeriodMinutes,"RSI",0,i));
      }
   FileClose(handle);      
//----
   return;
   }
//+------------------------------------------------------------------+
//| script program start function                                    |
//+------------------------------------------------------------------+
int start()
  {
  int SymbolCounter,PeriodCounter; 
//----
   for (SymbolCounter=1;SymbolCounter<13;SymbolCounter++)
      {
      for (PeriodCounter=2;PeriodCounter<=6;PeriodCounter++)
         {
         //Print("NewBar on ",GetSymbolString(SymbolCounter),PeriodNumber(PeriodCounter),"M");
         RSI_output(GetSymbolString(SymbolCounter),PeriodNumber(PeriodCounter));
         }
      }
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
 
Good afternoon, I have a strange error 4023 when calling a function from a self-written dll, and one function from the dll is called normally, the other is not, what is this error, could not find a description of it, help please.
 
splxgf:
look for #property indicator_color1 Red


It is not in the code (mine). or it should be prescribed? for all 6? I'll post the code if you need it.

p.s. I must have misspoken. The Expert Advisor is written using the standard MA indicator (6 variables, respectively 6 lines), without using custom ones. After testing the Expert Advisor and calling the chart, I see 6 red lines. So I have to create a custom one? Or there is a line for assigning colours to lines of the standard indicator?