[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 242

 

Hi all.

Please write a script or advisor that gives a beep when a new bar appears.

Thank you !!!

 
ertcy:
Please help a newbie. I have made an Expert Advisor that uses iSAR() and Close() functions and displays their current values. When an Expert Advisor works the values of the Close function correspond to the price chart, but the values of iSAR are not the same and do not change on an interval of 10 candles or more. I have looked at the codes of Parabolic indicators (technical and custom), the iSAR function is in the comments. Can you tell me what to do to make iSAR work properly. Thank you.

I've noticed for a long time, the telepaths and psychics on this forum are simply worthless....
 

Hello everyone!

As usual I have a simple and maybe even silly question, but I want to get to the bottom of it.

Let's assume, there is an Expert Advisor consisting of three files.

1st one, the main one, contains include two other functions init(), denit(), start() and it calls custom functions (which are defined in second file).

2nd one contain definitions of custom functions. User defined functions in second file use auxiliary functions which are defined in third file.

3rd file contains the definition of the auxiliary functions.

How to use preprocessor in this case?

I do this:

1st file - #include <second file>

2nd file - #import <file with auxiliary functions>

auxiliary function1();

auxiliary function2();

auxiliary function3();

#import

The problem is, I'm not getting an exe-nick created...

Please assist...

 
fozi:

Hi all.

Please write a script or advisor that gives a beep when a new bar appears.

Thank you !!!



void NewBar(int tf) // tf - тайм-фрейм
 {                              
   static datetime NewTime;
   string SoundSuccess = "ok.wav";
   
   if(NewTime!=iTime(NULL,tf,0))
    {                  
      NewTime =iTime(NULL,tf,0);                  
      PlaySound(SoundSuccess); 
    }              
 }
 
easier if(Volume[0]==1) PlaySound("ok.wav");
 
BBSL:

Hello everyone!

As always I have a simple and maybe even silly question, but I want to get to the bottom of it.

Let's assume, there is an Expert Advisor consisting of three files.

1st one, the main one, contains include two other functions init(), denit(), start() and it calls custom functions (which are defined in second file).

2nd one contain definitions of custom functions. User defined functions in second file use the auxiliary functions which are defined in third file.

3rd file contains the definition of the auxiliary functions.

How to use preprocessor in this case?

I do this:

1st file - #include <second file>

2nd file - #import <file with auxiliary functions>

auxiliary function1();

auxiliary function2();

auxiliary function3();

#import

The problem is, I'm not getting an exe-nick created...

Please assist...

I assume you don't have very large functions that you want to connect to your EA.

So I suggest to just copy and paste them at the end of your EA, outside of the start() function.

It will make your life much easier.

 
DhP:

THANK YOU !!!
 

Is it a script or an expert ???

 
DhP:

I assume you don't have very big functions that you want to connect to the EA.

So I suggest you just copy and paste them at the end of the EA code, outside the start() function.

It will make your life much easier.


Thanks for the tip!))

1000 lines of code at the end of start() is not convenient))

How would you solve the preprocessor issue?))

 
BBSL:


Thanks for the tip!))

1000 lines of code at the end of start() is not convenient))

How would you solve the preprocessor issue?))

Are you suggesting that having code outside the EA is more convenient?

If you can do something in the EA itself, you should do it in the EA,

That is, if it is not a dll, or an indicator, or a super-clever library that cannot do without each line.

Write the code in the EA.

Reason: