if (RSI0<RSIDownLevel&&RSIDownLevel<=RSI1){ TP=NormalizeDouble(Ask+takeprofit*Point,Digits); if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TP,NULL,Magic)==-1)Print(GetLastError());
if (positionTPask1>lastTPask1){ if (takeprofit!=0)TPm=NormalizeDouble(Ask+takeprofit*Point,Digits); if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TPm,NULL,Magic)==-1) Print(GetLastError()); }}
And I open 2 orders at one price at once... Is this correct? Check it out...
if (RSI0<RSIDownLevel&&RSIDownLevel<=RSI1){ TP=NormalizeDouble(Ask+takeprofit*Point,Digits); if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TP,NULL,Magic)==-1)Print(GetLastError());
if (positionTPask1>lastTPask1){ if (takeprofit!=0)TPm=NormalizeDouble(Ask+takeprofit*Point,Digits); if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TPm,NULL,Magic)==-1) Print(GetLastError()); }}
I opened 2 orders at one price ... Is this correct? Please check...
You should not dance from Ask-40*Point, but from the price at the opening of 1 position-40*Point.
I haven't worked with indicators much, so this may be a simple question, how do I disable the display of the graphical buffer inthe Data window? I want to remove buffer 3 and 4, here is the code:
#property strict#property indicator_chart_window#property indicator_buffers4#property indicator_color1 Black
#property indicator_color2 Yellow
#property indicator_color3 Black
#property indicator_color4 Black
//---- input parametersinputint RSIPeriod=14;
inputint Levl=50;
inputENUM_TIMEFRAMES TF=PERIOD_CURRENT;
//---- buffersdouble RSIBuffer[];
double MABuffer[];
double PosBuffer[];
double NegBuffer[];
//+------------------------------------------------------------------+//| Custom indicator initialization function |//+------------------------------------------------------------------+int init()
{
string short_name;
//---- 2 additional buffers are used for counting.IndicatorBuffers(4);
SetIndexBuffer(0,RSIBuffer);
SetIndexBuffer(1,MABuffer);
SetIndexBuffer(2,PosBuffer);
SetIndexBuffer(3,NegBuffer);
//---- indicator lineSetIndexStyle(0,DRAW_NONE);
SetIndexStyle(1,DRAW_LINE);
SetIndexStyle(2,DRAW_NONE);
SetIndexStyle(3,DRAW_NONE);
//----//---- name for DataWindow and indicator subwindow label
short_name="RSI("+IntegerToString(RSIPeriod,0,' ')+")";
IndicatorShortName(short_name);
SetIndexLabel(0,short_name);
SetIndexLabel(1,"Levl"+"_"+IntegerToString(Levl,0,' ')+" Price");
SetIndexLabel(2,"U");
SetIndexLabel(3,"D");
return(0);
}
This is modified RSI - buffers are needed there, because calculation is based on past data and I don't want to change buffer size every time (if it is not graphical) and add new data there, so graphical buffers are convenient for my purposes.
I haven't worked with indicators much, so this may be a simple question, how do I disable the display of the graphical buffer inthe Data window? I want to remove buffer 3 and 4, here is the code:
This is a modified RSI - buffers are needed there, because calculation is based on past data and I don't want to change buffer size every time (if it is not graphical) and add new data there, so graphical buffers are convenient for my purposes.
I don't know if I understood you correctly.
Try it like this:#property indicator_buffers2
#property strict#property indicator_chart_window#property indicator_buffers2#property indicator_color1 Black
#property indicator_color2 Yellow
Aleksey Vyazmikin: Thank you. This move will allow you to see the buffers that are not allowed to be output in the data window via iCustom?
iCustom allows you to see only what is in the data window. The penultimate parameter of the function is exactly the number of the buffer visible in the data window
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
I want to do the following!
When opened first trade at price for example 1.23455, I want that the second trade would be opened when the price will go to 1.23415
double lastTPask1=NormalizeDouble(Ask-40*Point,Digits);
if (RSI0<RSIDownLevel&&RSIDownLevel<=RSI1){
TP=NormalizeDouble(Ask+takeprofit*Point,Digits);
if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TP,NULL,Magic)==-1)Print(GetLastError());
if (positionTPask1>lastTPask1){
if (takeprofit!=0)TPm=NormalizeDouble(Ask+takeprofit*Point,Digits);
if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TPm,NULL,Magic)==-1) Print(GetLastError());
}}
Is this correct? Check it out...
sviter-pro:
And I have 2 orders open at once at the same price...Здраствуйте еще раз! Помогите с этой банальностью для вас, ато я разобраться не могу....
Хочу сделать следующее!
Когда открывается первая сделка по цене к примеру 1.23455, то хочу что бы вторая сделка открывалась когда цена пойдет на 1.23415
Is it done right? Would you look at this...
In the first line, I saw a strange thing. I did not look further.
What's this for?
On a calculator, multiply Ask by Point
I have a very good idea of how to correctly paste the code.
Hello again! Help with this triviality for you, because I can't figure it out....
I want to do the following!
When my first order opens at 1.23455, I want my second order to open when the price will go to 1.23415
double lastTPask1=NormalizeDouble(Ask-40*Point,Digits);
if (RSI0<RSIDownLevel&&RSIDownLevel<=RSI1){
TP=NormalizeDouble(Ask+takeprofit*Point,Digits);
if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TP,NULL,Magic)==-1)Print(GetLastError());
if (positionTPask1>lastTPask1){
if (takeprofit!=0)TPm=NormalizeDouble(Ask+takeprofit*Point,Digits);
if (OrderSend(Symbol(),OP_BUY,Lot,NormalizeDouble(Ask,Digits),slippage,0,TPm,NULL,Magic)==-1) Print(GetLastError());
}}
Is this correct? Please check...
I haven't worked with indicators much, so this may be a simple question, how do I disable the display of the graphical buffer inthe Data window? I want to remove buffer 3 and 4, here is the code:
This is modified RSI - buffers are needed there, because calculation is based on past data and I don't want to change buffer size every time (if it is not graphical) and add new data there, so graphical buffers are convenient for my purposes.
You should not dance from Ask-40*Point, but from the opening price1position-40*Point.
So read the opening price and dance....
I haven't worked with indicators much, so this may be a simple question, how do I disable the display of the graphical buffer inthe Data window? I want to remove buffer 3 and 4, here is the code:
This is a modified RSI - buffers are needed there, because calculation is based on past data and I don't want to change buffer size every time (if it is not graphical) and add new data there, so graphical buffers are convenient for my purposes.
I don't know if I understood you correctly.
Try it like this:#property indicator_buffers 2
I don't know if I've got it right.
Try it like this:#property indicator_buffers 2
It seems you are right! And out of the goodness of my heart, I thought it had to be declared if a graphical buffer was used for calculations.
Thanks!to disable the display in the Data window, do the following
To disable the output in the data window, do the following
Thank you. Will this move allow to see the buffers prohibited to output to the window via iCustom?
iCustom allows you to see only what is in the data window. The penultimate parameter of the function is exactly the number of the buffer visible in the data window