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

 
Roman.:

Thank you from the bottom of my heart - I will deal with the indicator after work.

You're welcome, I'll ask for help myself one day :)

I have added to the indicator the function to remember the balance at 0 o'clock. If you put StartBalance=0 - the calculation will be automatic. Put it on the account and the next day it should show, hopefully, valid results. Good luck!

Files:
 

I downloaded the libraries from Kim, put them in the include folder, plugged them into the Expert Advisor, but during compilation errors like these appear:

NumberOfTry' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (95, 28)
'UseSound' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (100, 21)
'SoundSuccess' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (100, 41)
'UseSound' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (103, 21)
'SoundError' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (103, 41)

'NumberOfTry' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (375, 20)

As far as I understand these variables are missing, there are errors there as well. Where can I get a list of them to declare?

 
nuan:

I downloaded the libraries from Kim, put them in the include folder, plugged them into the Expert Advisor, but when compiling, errors like this pop up:

NumberOfTry' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (95, 28)
'UseSound' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (100, 21)
'SoundSuccess' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (100, 41)
'UseSound' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (103, 21)
'SoundError' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (103, 41)

'NumberOfTry' - variable not defined C:\Program Files\ MetaTrader 4\experts\include\b-Positions_include.mqh (375, 20)

As far as I understand these variables are missing, there are errors in them too. Where can I get a list of them to declare them?

In your EA, declare them as external global variables... ... or just as global

 
Good afternoon, advise how to pass a value (1 or -1 or boolean) from the indicator and catch it in the Expert Advisor (iCustom or something like that), I tried SetIndexBuffer - nothing works - it passes 0.
 

Hi all!

Please see the code for filling the indicator array with values. For some reason, it hangs the terminal in this form, although it seems to work separately.

int k=Vnf2;

for (i=Vnf2;i>0;i--)

{

ArrayResize(Buf_DN,Vnf2+1);

Buf_DN[i]= EquationDirect(Vnf2,VMF2,Vnf1,VMF1,k);

k--;

}

 

Deal at a certain time


avatar
1
Mega4alik 03.08.2011 17:34

How do I write an EA which opens a deal at a certain second?

I could not think of anything but start, but it only opens when price changes, and I need it to open in a second

 
demlin:

Hi all!

Please see the code for filling the indicator array with values. For some reason, it hangs the terminal in this form, although it seems to work separately.

int k=Vnf2;

for (i=Vnf2;i>0;i--)

{

ArrayResize(Buf_DN,Vnf2+1);

Buf_DN[i]= EquationDirect(Vnf2,VMF2,Vnf1,VMF1,k);

k--;

}

1) use the SRC button

2) why are you allocating memory for the array in the loop? or is the variable Vnf2 changing its value in the EquationDirect function?

 
ilunga:

1) use the SRC button

2) why are you allocating memory for the array in the loop? or is the variable Vnf2 changing its value in the EquationDirect function?

1) what is this button?

2) it doesn't, I thought it was a mandatory procedure, but without this line the result is the same - the terminal hangs

 
demlin:

1) what is this button?

2) does not change, I thought it was a mandatory procedure, but without this line the result is the same - the terminal hangs

1) button to insert code as code instead of text

2) what happens inside EquationDirect(), what initially equals Vnf2?

 
ilunga:

1) button to insert code as code, not text

2) what happens inside EquationDirect() that initially equals Vnf2?

Inside the function, the price value is calculated using the straight line formula:

double EquationDirect(double x1, double y1, double x2, double y2, double x) // straight line

{

if (x2==x1) return(y1);

return((y2-y1)/(x2-x1)*(x-x1)+y1);}

Vnf2 is the bar number of the first point through which the line passes.

Ctrl+Alt+M was to insert code before, something does not work. SRC can't find it, sorry.