[Archive!] Any rookie question, so as not to clutter up the forum. Professionals, don't pass it by. Couldn't go anywhere without you - 2. - page 216

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
Thanks for the answer, but I have the algorithm written in Russian, but I'm not good at mql, at least a tip on the functions that fixed the number (I'll write it in the settings) of open sell/buy orders, and then the signal to prohibit placing sellstop/buystop pending orders.
Why isn't this algorithm, which you have already written, reflected in your code?
Do you think that just looking at your code you haven't written at once you can point out your error?
We still need to "read" it...
Here is an excerpt of code where everything we wrote on a bit of paper is shown in the code as well:
So, until the simplest thing is fixed, you shouldn't go further...
And what do you have? You've piled everything together, you haven't commented on a single line. Now take a week off and go back to your code. I'm sure it'll take you two hours to remember. 100%
Permanent lot 0.1.
In that case, in my opinion, it is a good result for the week. I do not remember exactly, I think it is about 800 points. Only the stability seems to me to be not all right: the chart is not very smooth... Anyway, thanks for the answer. At least at least some figure is emerging. I'm pretty far away from that: 3000-4000 points a year is the limit. But my balance chart is flatter...
I've been thinking: 0.1 fixed lot - but with what leverage? It's not quite clear from the balance chart how many points were earned?
How do I get the value of the selected Fiba level from such an indicator ?
//+------------------------------------------------------------------+
//| Parabolic_ZZ.mq4 |
//| Copyright © 2009, Vic2008 |
//| |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, Vic2008"
#property link ""
#include <stdlib.mqh>
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 Red
#property indicator_color2 Magenta
//---- input parameters
extern double SAR_step=0.02; //parameters parabolic.
extern double SAR_maximum=0.2;
extern int BarsCount = 500; //Distance in bars to draw the indicator.
extern bool Fibo1_off = False; //Disabling Fibo levels.
extern bool Fibo2_off = False;
extern bool Fibo_Absolut_Value = False; //Include the absolute price values at the Fibo levels.
extern color Label_Color = Gray;
extern color Fibo_Color = Blue;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialisation function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(0,DRAW_SECTION);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(1,DRAW_SECTION,0,2,Magenta);
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function |
//+------------------------------------------------------------------+
int deinit()
{
//----
ObjectsDeleteAll(0,OBJ_ARROW);
ObjectDelete("FiboZZLast");
ObjectDelete("FiboZZPrev");
//----
return(0);
}
//+------------------------------------------------------------------+
//| Custom indicator iteration function |
//+------------------------------------------------------------------+
int start()
{
//int counted_bars=IndicatorCounted();
string txt;
int w,PosLow,PosHigh;
double LPic=1000000,HPic=0,price;
datetime TimeTmp;
//----
ExtMapBuffer1[0]=Close[0];
ExtMapBuffer2[0]=EMPTY_VALUE;
for( w=0;w<BarsCount;w++){
if( w!=0 ){ ExtMapBuffer1[w]=EMPTY_VALUE; ExtMapBuffer2[w]=EMPTY_VALUE; }
if( iSAR(NULL,0,SAR_step,SAR_maximum,w) > Close[w] && LPic>=Low[w] ){ LPic=Low[w]; PosLow=w; }
if( iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && HPic<=High[w] ){ HPic=High[w]; PosHigh=w; }
// H -> L
if( iSAR(NULL,0,SAR_step,SAR_maximum,(w+1)) > Close[w+1] && iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && HPic!=0)
{
ExtMapBuffer1[PosHigh]=HPic;
ExtMapBuffer2[PosHigh]=HPic;
HPic=0;
}
// L -> H
if( iSAR(NULL,0,SAR_step,SAR_maximum,w) < Close[w] && iSAR(NULL,0,SAR_step,SAR_maximum,w+1) > Close[w+1] && LPic!=1000000 )
{
ExtMapBuffer1[PosLow]=LPic;
ExtMapBuffer2[PosLow]=LPic;
LPic=1000000;
}
}
if( Fibo1_off ) ObjectDelete("FiboZZLast");
if( Fibo2_off ) ObjectDelete("FiboZZPrev");
//Draw price marks and FIBO levels
int wave_cnt=0;
for( w=0;w<BarsCount;w++){
if( ExtMapBuffer2[w]!=EMPTY_VALUE ){
if( wave_cnt<=3 ){
ObjectDelete("PZZ_"+DoubleToStr( wave_cnt, 0));
ObjectCreate("PZZ_"+DoubleToStr( wave_cnt, 0), OBJ_ARROW, 0, Time[w], ExtMapBuffer2[w], Time[w], 0);
ObjectSet("PZZ_"+DoubleToStr( wave_cnt, 0), OBJPROP_ARROWCODE, SYMBOL_LEFTPRICE );
ObjectSet("PZZ_"+DoubleToStr( wave_cnt, 0), SYMBOL_LEFTPRICE, ExtMapBuffer2[w]);
ObjectSet("PZZ_"+DoubleToStr( wave_cnt, 0), OBJPROP_COLOR, Label_Color );
if(wave_cnt==1 && Fibo1_off==False ){
ObjectDelete("FiboZZLast");
ObjectCreate("FiboZZLast", OBJ_FIBO, 0, TimeTmp, ExtMapBuffer2[w], TimeTmp, price);
ObjectSet("FiboZZLast", OBJPROP_LEVELCOLOR, Fibo_Color);
ObjectSet("FiboZZLast", OBJPROP_COLOR, Fibo_Color);
ObjectSet("FiboZZLast", OBJPROP_RAY, False );// To enable the rays replace False with True
ObjectSet("FiboZZLast", OBJPROP_FIBOLEVELS, 14);
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+0,0.236); ObjectSetFiboDescription("FiboZZLast",0, "23.6");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+1,0.382); ObjectSetFiboDescription("FiboZZLast",1, "38.2");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+2,0.50); ObjectSetFiboDescription("FiboZZLast",2, "50.0");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+3,0.618); ObjectSetFiboDescription("FiboZZLast",3, "61.8");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+4,1.0); ObjectSetFiboDescription("FiboZZLast",4, "100.0");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+5,1.618); ObjectSetFiboDescription("FiboZZLast",5, "161.8");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+6,2.618); ObjectSetFiboDescription("FiboZZLast",6, "261.8");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+7,4.236); ObjectSetFiboDescription("FiboZZLast",7, "423.6");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+8,0.088); ObjectSetFiboDescription("FiboZZLast",8, "8.8");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+9,0.145); ObjectSetFiboDescription("FiboZZLast",9, "14.5");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+10,0.764); ObjectSetFiboDescription("FiboZZLast",10, "76.4");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+11,0.855); ObjectSetFiboDescription("FiboZZLast",11, "85.5");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+12,0.921); ObjectSetFiboDescription("FiboZZLast",12, "92.1");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+13,0.0); ObjectSetFiboDescription("FiboZZLast",13, "0.0");
if( Fibo_Absolut_Value ){
ObjectSet("FiboZZLast", OBJPROP_FIBOLEVELS, 14);
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+0,0.236); ObjectSetFiboDescription("FiboZZLast",0, "23.6 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+1,0.382); ObjectSetFiboDescription("FiboZZLast",1, "38.2 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+2,0.50); ObjectSetFiboDescription("FiboZZLast",2, "50.0 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+3,0.618); ObjectSetFiboDescription("FiboZZLast",3, "61.8 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+4,1.0); ObjectSetFiboDescription("FiboZZLast",4, "100.0 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+5,1.618); ObjectSetFiboDescription("FiboZZLast",5, "161.8 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+6,2.618); ObjectSetFiboDescription("FiboZZLast",6, "261.8 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+7,4.236); ObjectSetFiboDescription("FiboZZLast",7, "423.6 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+8,0.088); ObjectSetFiboDescription("FiboZZLast",8, "8.8 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+9,0.145); ObjectSetFiboDescription("FiboZZLast",9, "14.5 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+10,0.764); ObjectSetFiboDescription("FiboZZLast",10, "76.4 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+11,0.855); ObjectSetFiboDescription("FiboZZLast",11, "85.5 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+12,0.921); ObjectSetFiboDescription("FiboZZLast",12, "92.1 %$");
ObjectSet("FiboZZLast",OBJPROP_FIRSTLEVEL+13,0.0); ObjectSetFiboDescription("FiboZZLast",13, "0.0");
}
}
if( wave_cnt==2 && Fibo2_off==False ){
ObjectDelete("FiboZZPrev");
ObjectCreate("FiboZZPrev", OBJ_FIBO, 0, TimeTmp, ExtMapBuffer2[w], TimeTmp, price);
ObjectSet("FiboZZPrev", OBJPROP_LEVELCOLOR, Fibo_Color);
ObjectSet("FiboZZPrev", OBJPROP_COLOR, Fibo_Color);
ObjectSet("FiboZZPrev", OBJPROP_RAY, False );// To enable the rays replace False with True
ObjectSet("FiboZZPrev", OBJPROP_FIBOLEVELS, 14);
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+0,0.236); ObjectSetFiboDescription("FiboZZPrev",0, "23.6");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+1,0.382); ObjectSetFiboDescription("FiboZZPrev",1, "38.2");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+2,0.50); ObjectSetFiboDescription("FiboZZPrev",2, "50.0");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+3,0.618); ObjectSetFiboDescription("FiboZZPrev",3, "61.8");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+4,1.0); ObjectSetFiboDescription("FiboZZPrev",4, "100.0");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+5,1.618); ObjectSetFiboDescription("FiboZZPrev",5, "161.8");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+6,2.618); ObjectSetFiboDescription("FiboZZPrev",6, "261.8");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+7,4.236); ObjectSetFiboDescription("FiboZZPrev",7, "423.6");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+8,0.088); ObjectSetFiboDescription("FiboZZPrev",8, "8.8");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+9,0.145); ObjectSetFiboDescription("FiboZZPrev",9, "14.5");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+10,0.764); ObjectSetFiboDescription("FiboZZPrev",10, "76.4");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+11,0.855); ObjectSetFiboDescription("FiboZZPrev",11, "85.5");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+12,0.921); ObjectSetFiboDescription("FiboZZPrev",12, "92.1");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+13,0.0); ObjectSetFiboDescription("FiboZZPrev",13, "0.0");
if( Fibo_Absolut_Value ){
ObjectSet("FiboZZPrev", OBJPROP_FIBOLEVELS, 14);
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+0,0.236); ObjectSetFiboDescription("FiboZZPrev",0, "23.6 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+1,0.382); ObjectSetFiboDescription("FiboZZPrev",1, "38.2 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+2,0.50); ObjectSetFiboDescription("FiboZZPrev",2, "50.0 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+3,0.618); ObjectSetFiboDescription("FiboZZPrev",3, "61.8 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+4,1.0); ObjectSetFiboDescription("FiboZZPrev",4, "100.0 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+5,1.618); ObjectSetFiboDescription("FiboZZPrev",5, "161.8 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+6,2.618); ObjectSetFiboDescription("FiboZZPrev",6, "261.8 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+7,4.236); ObjectSetFiboDescription("FiboZZPrev",7, "423.6 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+8,0.088); ObjectSetFiboDescription("FiboZZPrev",8, "8.8 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+9,0.145); ObjectSetFiboDescription("FiboZZPrev",9, "14.5 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+10,0.764); ObjectSetFiboDescription("FiboZZPrev",10, "76.4 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+11,0.855); ObjectSetFiboDescription("FiboZZPrev",11, "85.5 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+12,0.921); ObjectSetFiboDescription("FiboZZPrev",12, "92.1 %$");
ObjectSet("FiboZZPrev",OBJPROP_FIRSTLEVEL+13,0.0); ObjectSetFiboDescription("FiboZZPrev",13, "0.0");
}
}
}
wave_cnt++;
price=ExtMapBuffer2[w];
TimeTmp=Time[w];
}
}
//----
return(0);
}
//+------------------------------------------------------------------+
How to get the value of the selected fibre level from such an indicator ?
what the fuck?
you might want to put "war and peace" in there as well.
help please... my Expert Advisor checks open orders ...one order can be open at a time ...but when I enter a stop on a straight line at the moment of opening an order it gives out error 130...for instance it was like this
if(down>0)
{ticket=OrderSend(Symbol(),OP_SELL,dLot,Bid,3,0,Bid-TakeProfit*Point,0,16384,0,Red);
I type in a stop of size 100
ticket=OrderSend(Symbol(),OP_SELL,dLot,Bid,3,100,Bid-TakeProfit*Point,0,16384,0,Red); ...gives error 130 in the tester
DTz Alpari...maybe I should modify p after open an order and place a stop?...tell me how roughly this can be done or point me to an EA where this is done...please
help please...
help please... the advisor has an open order check function ...one order may be open at a time ...but when entering a stop size directly at the time of opening
a new order may be modified after it has been opened and a stop may be set ... could you please advise how to do this or point me to an EA where this is done ... please
A stop should be of type double. The price at which the stop should be set should be specified.
100*Point
Why isn't this algorithm you have already written reflected in your code?
Do you think that just looking at your unformatted code you can immediately point out your error?
You still need to "read" it...
Here is an extract from the code where everything you've sketched out on a piece of paper is shown in the code as well:
So, until you get the simplest thing right, you shouldn't go any further...
What about you? You've piled everything together, you haven't commented on a single line. Now take a week off and go back to your code. I'm sure it'll take you two hours to remember. 100%
Sorry, the code is not mine, I'm studying it myself. This was a part concerning pending orders, the rest was blah-blah, like we usually do with settings, lots, fractals and trawl. This EA is not working, i.e. it is losing because of piled orders, so I have decided to place some restrictions and see what happens. I will use the mql language but I have no idea what to do with it. Thanks, I will look into it.
That's weird. What's there to apologize for? Well... I've shown you how you should design your own codes, so you don't have to figure it out later.
And since your code is someone else's... But... You can also comment on those strings, which meanings became clear to you during the analysis. After that it will be clearer, and you'd better write your own one on the basis of the analyzed one. So to fully comprehend, understand and convert it to your own needs.
That'sexactly what will lead you to a logical understanding. It will also be good for you. :)
Good luck!