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

 
kwadrad:

Please tell me how to describe OBJ_LABEL so that it looks like a rectangle with specified colour

This code draws the label, but I've seen OBJ_LABEL make it look likea rectangle, but the code is in EX4 format, so I can't look at it.

Maybe someone knows how to do it?


As an option

Only OBJ_LABEL

 
VladislavVG:

I told you to read the documentation. I'll explain it to you: can't you read the function's help?

Or are you going to keep banging on the open door?


Thank you very much, God bless you!
 
Vinin:


Alternatively

Only OBJ_LABEL

No code...

And how are the arrows (OBJ_ARROW) attached to screen coordinates and not to price and time? Or are the object parameters constantly changing?

 
MaxZ:

You didn't give the code...

And how are the arrows (OBJ_ARROW) attached to screen coordinates, not to price and time? Or are the object parameters constantly changing?


The arrows are attached to screen coordinates. I can't show you the code yet.


The menu system, the panels open/close. The panels have different functions. One of the panels controls parameters of the indicator (just through the arrows). On the second panel will be information about the effectiveness of the selected parameters

The size and position of the panels can be adjusted using the controls

 
MaxZ:

Can I take a message?

Can I do everything at once?

Some people don't even rest on weekends...


Why are you so quick to say that? I've just been busy. At work today. But to the point... On one of the forums I found an indicator TD Sequential.mq4. Is it possible to attach an audible signal when a blue and red 9 (nine) appear?
 

//+------------------------------------------------------------------+
//| TD Sequential.mq4 |
//| Copyright © 2004, MetaQuotes Software Corp. |
//| https://www.metaquotes.net/ |
//+------------------------------------------------------------------+
#property copyright "James OBrien"
#property link "https://www.metaquotes.net/"
//----
#property indicator_chart_window
#property indicator_buffers 1
#property indicator_color1 LimeGreen
//#property indicator_color2 Red
//---- input parameters
//int shift=0;
int i;
int num=0;
int num1=0;
string textVar;
//---- buffers
double ExtMapBuffer1[];
//double ExtMapBuffer2[];
//double b4plusdi,b4minusdi,nowplusdi,nowminusdi;
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_ARROW);
SetIndexArrow(0,159);
SetIndexBuffer(0,ExtMapBuffer1);
/*
SetIndexStyle(1,DRAW_ARROW,EMPTY);
SetIndexArrow(1,234);
SetIndexBuffer(1,ExtMapBuffer2);
*/
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custor indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//---- TODO: add your code here
int limit;
limit=1500;
for(int i=limit; i>=0; i--)
{
ObjectDelete(""+i);
}
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
int limit;
int counted_bars=IndicatorCounted();
//---- check for possible errors
if(counted_bars<0) return(-1);
//---- last counted bar will be recounted
if(counted_bars>0) counted_bars--;
limit=1500-counted_bars;
//---- macd counted in the 1-st buffer
for(int i=limit; i>=0; i--)
{
if(Close[i+1]<Close[i+5])num=num + 1;
else num=0;
if (num > 0 && num < 10)
{
textVar=num;
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
ObjectSetText(""+i, ""+DoubleToStr(num,0), 10, "Arial", Red);
}
if (num==9)
{
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
ObjectSetText(""+i, ""+DoubleToStr(num,0), 16, "Arial", Red);
}
else if((Close[i+1]<Close[i+5])&& num>=10)
{
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],Low[i+1]-5*Point );
ObjectSetText(""+i, ""+DoubleToStr(num,0), 10, "Arial", Orange);
}
if(Close[i+1]>Close[i+5]) num1=num1 + 1;
else num1=0;
//----
if (num1 > 0 && num1 < 10)
{
textVar=num1;
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
ObjectSetText(""+i, ""+DoubleToStr(num1,0), 10, "Arial", RoyalBlue);
}
if (num1==9)
{
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
ObjectSetText(""+i, ""+DoubleToStr(num1,0), 16, "Arial", RoyalBlue);
}
else if((Close[i+1]>Close[i+5])&& num1>=10)
{
ObjectCreate(""+i, OBJ_TEXT, 0, Time[i+1],High[i+1]+10*Point );
ObjectSetText(""+i, ""+DoubleToStr(num1,0), 10, "Arial", LightSkyBlue);
}
}
//----
return(0);
}
//+------------------------------------------------------------------+

 

MaxZ:


Let's forget for a moment that on the contrary, for Buy you should set StopLoss lower and for Sell higher...


Let's take the currency pair EURUSD. I need to open a short position. I select the first available terminal:

- quotes are 4 digits;

- the last fixed Bid = 1.4396 (of course, the Bid is different in the test, but the point is not the point);

- MarketInfo(Symbol(),MODE_STOPLEVEL) returns value 2.

Let's calculate the value of the variable VStopLossShort:

O_O

Although, if a pair is selected, for example, USDJPY, if you accidentally swap SL and TP, there shouldn't be an error... :)))))))))))))))))


Yes, thank you. And Roman thanks. Got it all :).

Tell me please, are there any statistics, what is the desirable stop loss level for currency pairs? For example for AUDCAD - 100 pips, for AUDCHF - 150 pips etc. Or it all depends on the strategy?

 
first_may:


Yes, thank you. Thanks to Roman. I got it :).

Do you have any statistics about the desired stop loss level for currency pairs? For example for AUDCAD - 100 pips, for AUDCHF - 150 pips etc. Or it all depends on the strategy?


Read the "Stops" thread... And share the answer... :-)))
 
Roman.:

Read "Stops" thread and share your answer... :-)))


Yes, I'll read it now... Also, can you tell me, I tested the system and got the following report. Please critique it :).

PS. lot size (if relevant):

double MinLot=MarketInfo(Symbol(),MODE_MINLOT); // Minimum lot size

Reason: