Any rookie question, so as not to clutter up the forum. Professionals, don't pass by. Nowhere without you - 6. - page 153

 

EVladMih:,

but you probably shouldn't divide people into bathhouses on the basis of local/non-local.

It's not about "local/non-local" of a particular person. It's about the way the person asks the question. If I got his question wrong, that does not give him the right to be rude. I honestly tried to help him. And I think if he had told me after my answer that this is not what he wanted and asked for, and explained the specific task he was given, we would have figured out how to do everything quickly and efficiently.

Now you're talking about how he can't identify the crossover with the trend line. But that just makes you smile. Or maybe I've got it all wrong again and deserve another boorishness? The simple ObjectGetValueByShift() function will return the price of the trend line on a certain bar. So compare one price with another.

 
artmedia70:
As far as I understand, he wants the object to be positioned vertically and not shifted horizontally at the lowest price of the bars that are displayed on the screen. I showed him the first part of his question - how to find the minimal price on the chart. He did not understand and barked at me. Now let him look for himself how to do what he needs without crossing two coordinate systems. This is easy. Maybe someone else will do it for him, but I take my leave. I don't like boorish people and freeloaders - he didn't even bother to look into the matter and write something in code himself.

artmedia70, I am a non-confrontational person and if I said something wrong, I apologise and ask that it not be considered rude.

I really do not know how to solve the problem.

Crossed 2 coordinate systems so far in a simple way: made a label and manually put it to the minimum price - so I have a coordinate Y label and it corresponds to the minimum price, which I get with the function WindowPriceMin() . But it's manual, I'd like to track and correct it programmatically.

If there really is a solution for this, and a simple one at that, I'd be grateful for help.


 
artmedia70:

Now you're saying that it cannot detect a crossover with the trend line. But that just makes me smile. Or did I misunderstand everything again and deserve another boorishness? The simple ObjectGetValueByShift() function will return the price of the trend line on a certain bar. So compare one price with another.


Don't listen to EVladMih - he's not making any sense .
I know very well how to find the distance to the trend when it comes to price. The question is different.

I use markers in my indicator that hang permanently at the top of the screen. It is after shifting any marker that the distance from the marker to the trend line should be determined, but the marks have coordinates (x,y) on the screen, while ObjectGetValueByShift works with the price, i.e. in another coordinate system. That's where all the fuss came from.

I can't use the OBJ_TEXT object with price coordinates, because I want it to stay in one place, like labels ( OBJ_LABEL object) do, if I move the chart, instead of tags.

 
satorifx:

Don't listen to EVladMih - he writes nonsense .
I know very well how to find the distance to the trend when it comes to price. The question is different.

In my indicator I use markers that are constantly hovering at the top of the screen. It is after shift of any marker that distance from marker to the trend line should be determined, but marks have coordinates (x,y) on the screen, while ObjectGetValueByShift works with price, i.e. in another coordinate system. That's where all the fuss came from.

I want to say in advance that I can't use the OBJ_TEXT object with price coordinates instead of labels, because I want them (labels) not to be shifted to the price if I move the chart, but to stay in one place, like labels do ( OBJ_LABEL object).

To avoid bothering with recalculations, use ARROW with constant x-coordinate = particular bar instead of labels. You can store and modify the bar in the object description. As soon as the object is moved, write a new x-coordinate equal to the new bar into its description. Then there won't be any problems with price search. And always locate the object by its description on the horizontal axis. The vertical axis is the price. This is a less costly option. And the object will always be on the x-axis at the same location, corresponding to a particular bar number.

ZS "...my apologies and please don't take it as boorish..." It's OK, let it go... ;)

 

I've made up an indicator. Divides one pair by another, to get instruments not included to the terminal. But now it loads the terminal and recalculates on every tick. I have entered it as in my Expert Advisor

if (Time[0]<=PrevTime) return(0);

PrevTime=Time[0];

Now it only draws on a new candle. Please tell me how to do it. Text of the indicator.

P/S/ By the way. All pairs are shown normally. I want to see Appl to Ruble. I do not want to see it.

#property indicator_separate_window
#property indicator_buffers 1
#property indicator_color1 Lime
//--- input parameters
extern string Paar_1="EURUSD"; //Desired symbol for comparison
extern string Paar_2="GBPUSD"; // desirable instrument for comparison
extern bool Mirroring_Paar_2=false;
//--- buffers
double ExtMapBuffer1[];
static int PrevTime=0;
int start=1;


//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
string short_name=Paar_1;
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----

//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
if (Time[0]<=PrevTime && start==1) return(0);
PrevTime=Time[0];
int i, counted_bars=IndicatorCounted();
i=counted_bars-1;
//----
while(i>=0){
double Compare1=iClose(Paar_1,0,iBarShift(Paar_1,0,iTime(Paar_1,0,i),FALSE));
double Compare2=iClose(Paar_2,0,iBarShift(Paar_1,0,iTime(Paar_1,0,i),FALSE));
if(Compare2!=0 && Compare1!=0) double Compare=Compare1/Compare2;
if(Mirroring_Paar_2==1) Compare=1/Compare;

ExtMapBuffer1[i]=Compare;
RefreshRates();
i--;
}
//----
start=0;
return(0);
}
//+------------------------------------------------------------------+y

 
Hello
Help! How do I make a delay between order openings, Sleep 3000? I don't remember exactly.
int start() {
string ls_0;
int li_8;
bool li_12;
int li_20;
int li_24;
double ld_28;
int li_36;
int li_40;
string ls_48;
string ls_56;
string ls_64;
double ld_76;
int li_84;
And it should go in here.

Just in case the owl itself

Another question, this owl is set for seven pairs at once, I specifically need to make a pause between opening orders! For example, today 10 orders have been opened simultaneously on the news and I need it with a delay!

Thank you!

/* Decompiled deleted - Vinin */

 

I just remembered, can you tell me where to insert Sleep(60000); so that there would be a delay between openings

if (ai_8 == OP_BUY) ad_20 = Ask;
if (ai_8 == OP_SELL) ad_20 = Bid;
if (!IsTradeContextBusy()) {
li_68 = OrderSend(as_0, ai_8, ad_12, NormalizeDouble(ad_20, MarketInfo(as_0, MODE_DIGITS)), ai_28, NormalizeDouble(ad_32, MarketInfo(as_0, MODE_DIGITS)), NormalizeDouble(ad_40,
MarketInfo(as_0, MODE_DIGITS)), as_48, ai_56, ai_60, ai_64)
if (li_68 > 0) {
Print("orderSendReliable(): Success! Ticket: " + li_68);
return (li_68);
}



 

You stole it, but you have no idea what to do with it))

i have not written any advisors for myself, i only read, examine crooked owls on their block-schemes, trying to understand the best approach

so i may be wrong.

int counterrore=0, //подщет количества ошибок открытия ордера
timesleep=10000; // время задержки
while () // до тех пор пока не будет выход с цыкла
{
 if (!IsTradeContextBusy())
 { 
  RefreshRates(); // последние данные
  if (ai_8 == OP_BUY) ad_20 = Ask;
  if (ai_8 == OP_SELL) ad_20 = Bid;
  li_68 = OrderSend(as_0, ai_8, ad_12, NormalizeDouble(ad_20, MarketInfo(as_0, MODE_DIGITS)), ai_28, NormalizeDouble(ad_32, MarketInfo(as_0, MODE_DIGITS)), NormalizeDouble(ad_40,
  MarketInfo(as_0, MODE_DIGITS)), as_48, ai_56, ai_60, ai_64);
  if (li_68 > 0) 
  {
   Print("orderSendReliable(): Success! Ticket: " + li_68);
   return (li_68);
  }
  Print("orderSendReliable(): False! Error " + GetlastError()); // поищите коректную функцию обработки ошибок
  counterrore++; // количество неудач - сумирование

  if(counterrore>6) // если не удалось 6 раз открыть
  {
   Print("orderSendReliable(): Error!!! " +counterrore+"times --return(-1)" ); // сообщаем логу о даной трагедии
   return (-1); // -1 или что там Вы придумаете для отработки ситуации
  }
 }
 Sleep (timesleep); // время сна для цикла посылки  запроса на сервер и для !IsTradeContextBusy()
}
 
Now the moderators will come and ban the last two in front of me :-))
 
Zhunko:
Now the moderators will come and ban the last two in front of me :-))

May I ask why?

it is forbidden to edit decompiles?

By registering at MQL4.com you agree to the following rules:

  1. When communicating on this site be courteous. Comments that offend or insult other visitors are forbidden.
  2. Any discussions about any banking, brokerage or other financial institutions are forbidden. Such posts are subject to deletion.
  3. Any form of openly expressing your personal relationship between the participants is forbidden on the site.
  4. Any use of obscene expressions is forbidden.
  5. Adverts, spam, and flooding are prohibited.
  6. Repeated violations of the rules, ignoring the comments of the moderator, and even more - openly disrespectful to the Administration of an online resource, leads to blocking the account ("ban").
  7. The site administration has the right to make any changes to the rules that they deem necessary.

Since when is decompile a foul language?

Reason: