Ask! - page 96

 

Putz,

It is likely in your EA.

Checking and computing everything on every tick will slow it down a lot,

but yours sounds so slow I wonder if you have loops of loops that make it extra slow. You can send it to me if you want, I can look at it, I may have suggestions.

Big Be

 

Help on my code

Hi,

In my exmaple i would like to compute an indicator (in my example is a Hull MA) in a function, because the goal is to apply the indicator to the tab passed in a function's argument. Do you think this code is it correct ?

On the graphic the blue curve is the indicator compute all in start function, the red curve is the same indicator compute with a call at a function, i don't understand why the results are not the same ?

Regards

Files:
 

how to use Icustom/create EA from custom indicator

Hi. As you can probably tell by my attached EA im no programmer... I have tried to create an EA using some expert advisor builder on the web. Now, i can manage to make a basic EA, with a common indicator.

But im having a real hard time understanding how to incorporate a custom indicator in the EA. Is it necessary to call the indicator from within the EA, or could the indicator code be put directly in the EA? I have tried both and figured maybe the easiest task would be to call the indicator using the icustom function... But it seems that event that was too advanced for me....

In a nutshell, the EA needs to Buy and Sell whenever the custom indicator says so. I would really appreciate any help suggestions i can get...

Im attaching my EA and the custom indicator...

Files:
td.mq4  7 kb
 

I'm confused about this

Hi guru,

I have a little prob with my MQL4 code,

i got message ZERO DIVIDE at my experts message.

I'm sure there were no any divide operation will give zero value to my equation.

While i mark some of my code statement with '//', and compile to run,

my code run very well.

After then i open my mark '//' again, at the same place and compile to run again, my code also can run very well again.

If my code have problem, then i'm pretty sure while open the mark '//' an make compilation, my code can't run well, right ?

Is this bugs from MQL4 or i'm write bad code or bad logic on my MQL4 ?

I read from MLQ4 forum, found their explain, that is hard to found why make we got ZERO DIVIDE

Thanks in advanced for one answer this problem

Files:
 

Hi maybe someone knows how to make this ea close trades...

Files:
 

Thanks Big Be

Hi Big Be,

Thanks for your offer to help. I took the whole program apart into bits and pieces and finally got it to do backtesting. Now I have another issue of it not closing the orders at the right time but I want to try to figure that one out myself. It's the best way to learn. I will keep your contact info if I can't get out of this one.

Thanks again

Putz

 

I Found the problem ! TQ for let me post here !

Just found the problem and how to solve,

I'm using function

MarketInfo(Symbol(),MODE_POINT)

without any trade / history record,

That function only show data from pointed record.

I change my code to Point ( predefined variable )

It seems same problem with :

MarketInfo(Symbol(),MODE_BID) should change to Bid

MarketInfo(Symbol(),MODE_ASK) should change to Ask

BornToWin:
Hi guru,

I have a little prob with my MQL4 code,

i got message ZERO DIVIDE at my experts message.

I'm sure there were no any divide operation will give zero value to my equation.

While i mark some of my code statement with '//', and compile to run,

my code run very well.

After then i open my mark '//' again, at the same place and compile to run again, my code also can run very well again.

If my code have problem, then i'm pretty sure while open the mark '//' an make compilation, my code can't run well, right ?

Is this bugs from MQL4 or i'm write bad code or bad logic on my MQL4 ?

I read from MLQ4 forum, found their explain, that is hard to found why make we got ZERO DIVIDE

Thanks in advanced for one answer this problem
 

For Putz

You are welcome. I hope it goes well.

Keep learning!

Big Be

 
 

Putz' EA

Putz,

Well, I set it up and made some progress.

the indicator I have is 'Stochastic_RSI', not 'Stochastic RSI', so I changed that in iCustom and it takes trades.

Then I get 2 errors in Strat tester:

Tester: exchange rate cannot be calculated

and

Zero Divide.

That's all I can do tonight.

Good Luck.

Big Be

Reason: