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

 
wenay:

Task: You need to find the tick of a newly appeared order for this particular TS without using a magik .
Check order open time and extract the one opened last by time
 
sanyooooook:
Check the opening times of the orders and pull out the one that was opened last


Here's what I thought: just compare all parameters, there is a brokerage company where the new order will be the last, there are those where the moment of opening coincides with a partial closing order, so I will process 2 moments.

I think the question is closed. Thank you

 
ToLik_SRGV:
Many thanks, I couldn't find such an article on the forum, if there really is no such information, I think it would be worth adding it to the moderators in the relevant section
 

How can the inscription be implemented in the upper right corner:

if (naklon> naklonmax) printvuglusprv(" trend up, no shorting allowed)

 
Craft:

Good people, have mercy - I can't get: buy/sell after another peak of smoothed CCI.

I tried to declare the second buffer (it makes more sense to me), no errors, log - silent, print, apparently, as a goat - I don't understand anything.

Attachment contains the entire Expert Advisor. After testing in visualization, CCI is drawn both in this and old version (it is plotted in the attached file), but smoothed one is not and therefore trades are not opened.

Old variant:

I understand the time no one has the problem of others to sort out, tell me at least where exactly to insert Print and where to look for feedback in the journal or the logs and what you need to pay attention to.

You must first insert Print() here:

double c1s[];
   ArrayResize(c1s,PeriodS);
   double c1s_1[];
   ArrayResize(c1s_1,AvgS);
   for(i=1;i<=PeriodS;i++)
   {
   c1s[i]=iCCI(NULL,0,PeriodS,PRICE_TYPICAL,i);
   {
   c1s_1[i]=iMAOnArray(c1s,0,AvgS,0,MODE_SMA,i);
   }
   }

Print("NormalizeDouble(c1b_1[i],4) - ",NormalizeDouble(c1b_1[i],4));
Print("NormalizeDouble(c1b_1[i+2],4) - ",NormalizeDouble(c1b_1[i+2],4));
Print("NormalizeDouble(c1b_1[i+3],4) - ",NormalizeDouble(c1b_1[i+3],4));

if (NormalizeDouble(c1b_1[i],4)<NormalizeDouble(c1b_1[i+2],4)&&NormalizeDouble(c1b_1[i+2],4)>NormalizeDouble(c1b_1[i+3],4))
     {                                          // 
      Opn_B=true;                               // Критерий откр. Buy
      Cls_S=true;                               // Критерий закр. Sell
     }
to make sure that the array c1b_1[i] is empty, so comparing zeros in if, of course no deals are opened.

And zeros there because the averaging period in function iMAOnArray(c1b,0,AvgB,0,MODE_SMA,i) (extern int AvgB=25;) is larger than array c1b itself , ArrayResize(c1b,PeriodB ) (extern int PeriodB=20;), so it cannot average anything.

 
Rossi:

How can the inscription be implemented in the upper right corner:

if (naklon> naklonmax) printvuglusprv(" trend up, no shorting allowed)

int init()
  {
   if(!ObjectCreate("control", OBJ_LABEL, 0, 0, 0))Print("error: can't create text_object! code #",GetLastError());
      else{
            ObjectSet("control", OBJPROP_CORNER, 0 );
            ObjectSet("control",OBJPROP_XDISTANCE,30);
            ObjectSet("control",OBJPROP_YDISTANCE,40);
            ObjectSetText("control", "NO BUY", 18, "Times New Roman", Red);
           }
   return(0);
  }

int start()
  {
if ( naklon> naklonmax )  ObjectSetText("control", "тренд вверх, шорт запрещен", 18, "Times New Roman", Blue);


return(0);
}
brackets don't check
 
IgorM:
count the brackets didn't check

Deinit would have to clean the 0 window afterwards to sweep it up... :)
 
IgorM:
count the brackets didn't check.


Thanks, I messed up, I don't want a print, I want an inscription on the screen ...

I thought it was done in one line...

 

In the Indexes_v8L indicator I changed currencies

"AUDUSD", "EURUSD", "GBPUSD", "NZDUSD", "USDCAD", "USDCHF", "USDJPY"

to

"EURUSD", "EURGBP", "EURGBP", "EURJPY", "EURAUD", "EURCAD", "EURNZD"

GBP line has disappeared.

Where to dig?

Files:
 
Rossi:


Thanks, I messed up, I don't want a print, I want a screen caption ...

I thought it was one line...

You've been told how to do the lettering on the screen:

if ( naklon> naklonmax )  ObjectSetText("control", "тренд вверх, шорт запрещен", 18, "Times New Roman", Blue);

18 - font size, Times New Roman - font name, Blue - your inscription colour... Write your own values instead...

All other lines are preparation of graphic objects for displaying them on the screen. You can't do anything without it.

ObjectSet("control", OBJPROP_CORNER, 1 );  // Устанавливает в каком углу окна будет выводиться надпись 0 = лево-верх, 1 = право-верх, 2 и 3 низ
ObjectSet("control",OBJPROP_XDISTANCE,30); // Устанавливает координату X будущей надписи
ObjectSet("control",OBJPROP_YDISTANCE,40); // Устанавливает координату Y будущей надписи
ObjectSetText("control", "NO BUY", 18, "Times New Roman", Red); // Эту строку в init() можете не писать, тогда не будет сразу надписи NO BUY
                                                                // Далее, уже по ходу основной программы в ф-ции start() проверяете условия и
                                                                // при их выполнении выводите строку в уже заранее заданные координаты:
if ( naklon> naklonmax )  ObjectSetText("control", "тренд вверх, шорт запрещен", 18, "Times New Roman", Blue);
 

Or write Comment` in upper left corner. You have to think less there...