Forex



Go Back   Forex Trading > Discussion Areas > Suggestions for Trading Systems
Forex Forum Register More recent 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
  #1 (permalink)  
Old 08-18-2009, 03:33 AM
Junior Member
 
Join Date: Jun 2009
Posts: 5
bellco is on a distinguished road
Need some help w/ logic+syntax


Hi there:
Well, I just downloaded the MetaTrader.
Made (half way): a trend following program.

TendUp: if 3 consecutive bars have both -- increasing Highs & increasing Lows.
TrendDown: if 3 consecutive bars have both -- decreasing Highs and decreasing Lows.

Tying to follow the trend and exit by: putting in OrderModify based on the highest High from the last 6 bars (or the lowest Low from the last 6 bars) as long as the ticket is still active in the market.

Then, stay out of the market for 3 bars, to avod sideways action.

Well that is the idea.
However, in practice: Have difficulty to get past the "compile" step.
(The logic might not have been coded right: still working on the if-while and {}...

So attaching my code (such as it is).

If someone could get the program to perform, one could (finally) see if it an OK idea, or not.

Thanks......
Attached Files
File Type: mq4 XWE.mq4 (5.9 KB, 17 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
  #2 (permalink)  
Old 08-18-2009, 11:10 PM
cockeyedcowboy's Avatar
Senior Member
 
Join Date: Nov 2005
Posts: 486
cockeyedcowboy is on a distinguished road
Quote:
Originally Posted by bellco View Post

Hi there:
Well, I just downloaded the MetaTrader.
Made (half way): a trend following program.

TendUp: if 3 consecutive bars have both -- increasing Highs & increasing Lows.
TrendDown: if 3 consecutive bars have both -- decreasing Highs and decreasing Lows.

Tying to follow the trend and exit by: putting in OrderModify based on the highest High from the last 6 bars (or the lowest Low from the last 6 bars) as long as the ticket is still active in the market.

Then, stay out of the market for 3 bars, to avod sideways action.

Well that is the idea.
However, in practice: Have difficulty to get past the "compile" step.
(The logic might not have been coded right: still working on the if-while and {}...

So attaching my code (such as it is).

If someone could get the program to perform, one could (finally) see if it an OK idea, or not.

Thanks......


There is too many blocks of codes that are questionable as to your intend, to do any alterantions. like the block be low, are these if statments inbedded? can not tell if they are or not other then the indenting tells me they may or should be.



Code:
 if ((High(c)> High(b)>High(a))
   bool bHigh3down=true;
  if(Low(c)> Low(b)>Low(a))
   bool bLow3down=true;
   if (bHigh3down && bLow3down)
 bool bTrendDown=true;

your use of the while statement is incorect as well and no indication as to what should be included within that statment as well. a while statement should look like


while( x>=4 ) {

if the while statement is true do these command in side brakets

} end of while statement


You should also pay attention to the scope of your variables dimming and redimming your arrays on each tick is not in almost all cases not needed.

you should take more time reading the limited documentation included with the software and then take some code that some one else has done and make changes to that to that code to find out how each statement response to your changes this will get you a starting handle on the coding.
__________________
(If one expects unbutchered use of the english laugage or even corect spelling, then I advise you not to reed any of my rightings.)
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
  #3 (permalink)  
Old 08-19-2009, 04:37 AM
Junior Member
 
Join Date: Jun 2009
Posts: 5
bellco is on a distinguished road
Nope, the if statements referred to are not emmbedded.

But thanks for the advice: the machine might interpret them so.
So, I'll try to work on this.
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
  #4 (permalink)  
Old 08-20-2009, 12:22 AM
Junior Member
 
Join Date: Jun 2009
Posts: 5
bellco is on a distinguished road
Smile on second thought, the if statements are embedded.

But, the problem (overall is solved.)
Eventually, I'll pay some coder to get my little trading prog right.
Meanwhile, did write to mql.com on how their compiler report could be improved: Have the compiler number the lines of the human code. Then, report errors as: error on line 21, near character 30 (error/error).
And, if I ever become commercial quality, I would (as a trading idea), also se the "circle of winners" idea. [Same as "fantasy football".]
So: pick 10 EA-s that you like.
Go w/ them in real time.
(Since you are diversified, presumably as one loses, an other gains.)
Anyhow, when one prog loses 1/3 of its highest high of its earnings, replace it w/ an other nice prog.
Then, just continue this pattern of money management.
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


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Lesson 2 - SYNTAX codersguru Lessons 12 08-08-2009 03:08 AM
Need Help Understanding Basic MQL logic Emerald King Expert Advisors - Metatrader 4 7 02-27-2007 10:59 AM
Question about programming AMA logic into an EA zeroz Metatrader 4 mql 4 - Development course 4 12-09-2006 09:13 PM


All times are GMT. The time now is 04:05 AM.



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