can't get my EA to run - page 3

 

Thanks the New_Bar code works.

It takes apox. 4-6 seconds into the new bar

before it detects a new bar.

I'm beginning to understand some of the flow in coding an EA.

I still have some bugs in my coding to work out though.

My next fn project is dynamic trailling stop.

Any suggestions?

 
ray2955:

My next fn project is dynamic trailling stop.

Any suggestions?

Sounds like you are making progress :-)

Lots of trailing SL stuff on here, you can use Google to search this site specifically, e.g. http://crum.be/trailsl

 

Thanks again

Could you help me with this code

if statement

{

if statement

{

while(true) // what is it using for true

{

if statement

{

if statement

 
ray2955:

Thanks again

Could you help me with this code


Yep, please try to use SRC for code it makes it easier to read . .

if statement

{

if statement

{

while(true) // what is it using for true   <------- this is a perpetual loop, true == true, it keeps looping until a break somewhere else takes it out of the loop

{

if statement

{

if statement

                      //   probably a break somewhere down here to exit the loop . . .
 

It could just as easily use . . .

while (1 > 0)
 

Sorry I'm looking at a paper copy of a script.

I'm considering using if statements of conditions to OrderModify my stoploss for a dynamic trailing stop.

Will this produce any unforseen problems.

Scatch that last question i thought there was a trailingstop in OrderModify().

 
If you want a trailing stop you have to code it, there are plenty of examples on this forum . . . http://crum.be/trailsl
 

Thanks there is alot to look through.

There are some good custom indicators out there.

One of the ideas for an EA is to use an indicator to auto Buy sell.

I'm reading that i'm to use the #include directive.

#include <indicator name .mqh> header name.

Does this mean that the global variables of that indicator

with the assigned values are available on my EA ?

Or is it #import " indicator name.ex4"

 

Use of Indicators in an EA is usually via iCustom. You can pass variables to the indicator (that are specified in the Indicator code as extern) and you can get the Indicators buffers by return.

#include is used to bring additional files into your EA, #import allows you to bring in a specific function from an external file . . . I don't have much experience of using either.

https://docs.mql4.com/basis/preprosessor

Reason: