Forex



Go Back   Forex Trading > Training > Metatrader > Metatrader 4 mql 4 - Development course > Questions
Forex Forum Register More recent Blogs Calendar Advertising Others Help






Register
Welcome to Forex-TSD!, one of the largest Forex forums worldwide, where you will be able to find the most complete and reliable Forex information imaginable.

From the list below, select the forum that you want to visit and register to post, as many times you want. It’s absolutely free. Click here for registering on Forex-TSD.

Exclusive Forum
The Exclusive Forum is the only paid section. Once you subscribe, you will get free access to real cutting-edge Trading Systems (automated and not), Indicators, Signals, Articles, etc., that will help and guide you, in ways that you could only imagine, with your Forex trading.
  • Elite Section
    Get access to private discussions, specialized support, indicators and trading systems reported every week.
  • Advanced Elite Section
    For professional traders, trading system developers and any other member who may need to use and/or convert, the most cutting-edge exclusive indicators and trading systems for MT4 and MT5.
See more

Reply
 
Thread Tools Display Modes
  #951 (permalink)  
Old 01-27-2008, 11:49 AM
Badguy's Avatar
Member
 
Join Date: Jan 2006
Posts: 61
Badguy is on a distinguished road
Question How to write

Hi Coders

i'm totally newbie in Mql.4 coding. Still learning by modified existing EAs.

Following example for a floating Pivot:

for current Bar;

double Flow_Pivot0 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,0,0))/3.0;

for one bar back
where i must set "number" or Variable "shift_bars"

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,TimeFrame_Flow,0))/3.0;

Thanks a lot
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #952 (permalink)  
Old 01-27-2008, 05:13 PM
Bongo's Avatar
Senior Member
 
Join Date: Oct 2005
Posts: 496
Bongo is an unknown quantity at this point
BadGay,
go to:
Appendix 1 - BARS
B.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #953 (permalink)  
Old 01-27-2008, 07:50 PM
Badguy's Avatar
Member
 
Join Date: Jan 2006
Posts: 61
Badguy is on a distinguished road
No Solution found

Hi Bongo

sorry but on this link i don't found an answer.

Normal case

double High1 = iHigh(NULL,0,0); // Price high now

when i need for extern input

double iHigh1 = iHigh(NULL,iHigh12_TimeFrame,Barsback_iHigh1); // Price high now

Green means how many bars back


but in my case, where i must insert Barback_xxx, the full line below must be one bar back

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,TimeFrame_Flow,0))/3.0;





Quote:
Originally Posted by Bongo View Post
BadGay,
go to:
Appendix 1 - BARS
B.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #954 (permalink)  
Old 01-27-2008, 08:26 PM
cja's Avatar
cja cja is offline
Senior Member
 
Join Date: Apr 2006
Posts: 676
cja is on a distinguished road
Back Times

Quote:
Originally Posted by Badguy View Post
Hi Bongo

sorry but on this link i don't found an answer.

Normal case

double High1 = iHigh(NULL,0,0); // Price high now

when i need for extern input

double iHigh1 = iHigh(NULL,iHigh12_TimeFrame,Barsback_iHigh1); // Price high now

Green means how many bars back


but in my case, where i must insert Barback_xxx, the full line below must be one bar back

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,TimeFrame_Flow,0))/3.0;

Hi

If you want to shift the line back by 1 bar at a time.

double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,TimeFrame_Flow,0))/3.0; = Current Day

double Flow_Pivot1 = (iHigh(NULL,1440,1)+iLow(NULL,1440,1)
+ iClose(NULL,TimeFrame_Flow,1))/3.0; = Back 1 day

double Flow_Pivot1 = (iHigh(NULL,1440,2)+iLow(NULL,1440,2)
+ iClose(NULL,TimeFrame_Flow,2))/3.0; = Back 2 Days


double Flow_Pivot1 = (iHigh(NULL,1440,Barback_xxx)+iLow(NULL,1440,Barback_xxx)
+ iClose(NULL,TimeFrame_Flow,Barback_xxx))/3.0;

Barback_xxx = 1 ,2, 3, 4 etc will shift back 1 bar at a time.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #955 (permalink)  
Old 01-27-2008, 08:50 PM
Badguy's Avatar
Member
 
Join Date: Jan 2006
Posts: 61
Badguy is on a distinguished road
Hi Cja

its not what i mean


Quote:
Originally Posted by cja View Post
Hi

If you want to shift the line back by 1 bar at a time.

Thats floating PIVOT. Right?
#1
double Flow_Pivot1 = (iHigh(NULL,1440,0)+iLow(NULL,1440,0)
+ iClose(NULL,TimeFrame_Flow,0))/3.0; = Current Day

That's normal PIVOT for today. Right??
#2
double Flow_Pivot1 = (iHigh(NULL,1440,1)+iLow(NULL,1440,1)
+ iClose(NULL,TimeFrame_Flow,1))/3.0; = Back 1 day

That's normal PIVOT but from yesterday. Right??
#3

double Flow_Pivot1 = (iHigh(NULL,1440,2)+iLow(NULL,1440,2)
+ iClose(NULL,TimeFrame_Flow,2))/3.0; = Back 2 Days


I need #1, but xx bars back in any Timeframe.
Same function how this Indi : PrevDayAndFloatingPivot_O.mq4. ( but only the FloatingPivot )


Indi is attached


double Flow_Pivot1 = (iHigh(NULL,1440,Barback_xxx)+iLow(NULL,1440,Barback_xxx)
+ iClose(NULL,TimeFrame_Flow,Barback_xxx))/3.0;

Barback_xxx = 1 ,2, 3, 4 etc will shift back 1 bar at a time.
Attached Files
File Type: mq4 PrevDayAndFloatingPivot_O.mq4 (3.6 KB, 16 views)

Last edited by Badguy; 01-27-2008 at 08:53 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #956 (permalink)  
Old 01-27-2008, 09:01 PM
Junior Member
 
Join Date: Dec 2007
Posts: 1
xtrany is on a distinguished road
maybe this is a silly question... but i hope u'll help me.
.... how to close or open an order (pending order) when another order reach tp?
thanks b4 !
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #957 (permalink)  
Old 01-28-2008, 02:41 AM
Member
 
Join Date: Oct 2006
Posts: 80
Big Be is on a distinguished road
RE: Slow Backtesting

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #958 (permalink)  
Old 01-28-2008, 06:36 AM
Junior Member
 
Join Date: Dec 2007
Posts: 8
manu29 is on a distinguished road
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
Attached Images
File Type: gif hull_anticip.gif (24.3 KB, 123 views)
Attached Files
File Type: mq4 HULL_ANTICIP.mq4 (3.8 KB, 14 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #959 (permalink)  
Old 01-28-2008, 10:56 AM
BornToWin's Avatar
Junior Member
 
Join Date: Nov 2007
Posts: 26
BornToWin is on a distinguished road
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
Attached Images
File Type: gif ZeroDivide.gif (5.5 KB, 114 views)
__________________
BornToWin
Veni Vidi Vici
----------------------------------------------------------------
Knowledge is POWER, Experience is SKILL, Action got RESULT !
Yes I CAN !

Last edited by BornToWin; 01-28-2008 at 11:40 AM. Reason: Add result message
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
  #960 (permalink)  
Old 01-28-2008, 11:03 AM
Junior Member
 
Join Date: Jun 2007
Posts: 27
Ronyn is on a distinguished road
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...
Attached Files
File Type: mq4 YourExpertAdvisor.mq4 (9.0 KB, 21 views)
File Type: mq4 TD.mq4 (6.8 KB, 15 views)
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!StumbleUpon this Post!Reddit this Post!Facebook this Post!BlinkList this Post!Google Bookmarks this Post!Yahoo! My Web this Post!
Reply With Quote
Reply

Bookmarks

Tags
forex, histogram, JMASlope, ToR 1.20, ZUP_v1.mq4


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump


All times are GMT. The time now is 09:33 AM.



Search Engine Friendly URLs by vBSEO 3.2.0 ©2008, Crawlability, Inc.