• Home
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • User/Email: Password:
  • 1:04pm
Menu
  • Forums
  • Trades
  • News
  • Calendar
  • Market
  • Brokers
  • Login
  • Join
  • 1:04pm
Sister Sites
  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Options

Bookmark Thread

First Page First Unread Last Page Last Post

Printable Version

Similar Threads

I Will Learn Coding in 1 Month - Give me the 80/20 of MT4 Coding 14 replies

Support and Resistance Trading Simplified 249 replies

Simplified Trailing Stop 0 replies

Simplified Version Of (Fast) Stochastic 2 replies

a software that can offer a simplified rate of any currency in your screen 0 replies

  • Commercial Content
  • /
  • Reply to Thread
  • Subscribe
  • 70
Attachments: The Small Hours Simplified - Coding only
Exit Attachments

The Small Hours Simplified - Coding only

  • Last Post
  •  
  • Page 1 23456 11
  • Page 1 234 11
  •  
  • Post #1
  • Quote
  • First Post: Edited Feb 17, 2011 5:41pm Feb 14, 2011 6:42pm | Edited Feb 17, 2011 5:41pm
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
New topic ONLY for coding purpose of EA's, indicators and scripts for the strategy explained by Colostarr over here:
http://www.forexfactory.com/showthread.php?t=280540.

All questions and postings of code should be in this thread to keep Colostarr thread clean for trading purpose and learning only.

I'll post my latest version of the Small Hours indicator here:
Attached File
File Type: mq4 Small Hours v2-latest.mq4   10 KB | 288 downloads

Screenshot of the indicator:
Attached Image (click to enlarge)
Click to Enlarge

Name: Schermafbeelding 2011-02-14 om 18.18.38.png
Size: 39 KB

All options can be turned on/off.

Currently the Alert function is work in progress, so don't rely on it

UPDATE: new rules: http://www.forexfactory.com/showthread.php?t=281081
Latest version indicator: on page 5
  • Post #2
  • Quote
  • Feb 14, 2011 6:53pm Feb 14, 2011 6:53pm
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
Ruben5419 mentioned the following "bug" in my indicator:

Inserted Code
// if (iHigh(NULL,0,1)<High[iHighest(NULL,0,MODE_HIGH,5,1)]) ObjectSetText("rule2", CharToStr(130), 15, "Wingdings", Lime);
// if (setuplow>ll5) ObjectSetText("rule2", CharToStr(130), 15, "Wingdings", Red); //**** if between always red?????****

if (setuplow>ll5 && setuphigh<hh5) ObjectSetText("rule2", CharToStr(130), 15, "Wingdings", Yellow);
else if (setuphigh<hh5) ObjectSetText("rule2", CharToStr(130), 15, "Wingdings", Lime);
else if (setuplow>ll5) ObjectSetText("rule2", CharToStr(130), 15, "Wingdings", Red);

Any idea how to deal with this one? It seems to me, the rules both always apply, right?

Also, the following code is what i use, but should be changed to something working for everyone:
Inserted Code
atrvalue=iATR(NULL,0,20,0)*10000;  //this is my code
atrvalue=iATR(NULL,0,20,1)/Point; //this one didnt work for me (5digit broker?)

Similar also for the calculation of the hhll5 variable. Who's got a great idea?
  • Post #3
  • Quote
  • Feb 14, 2011 7:19pm Feb 14, 2011 7:19pm
  •  ruben5419
  • | Joined Feb 2011 | Status: Member | 10 Posts
Ido:
I test *10000 and /Point, the only diferency is in screen line ATR/HH%-LL% Range: Results is in pips (*10000) or in point (/Point)

Entry/TPs/Sl are correct anyway ever.

Mi brocker is Askobid, 5 digits.
dont understand were is the problem.
  • Post #4
  • Quote
  • Feb 14, 2011 7:55pm Feb 14, 2011 7:55pm
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
Quoting ruben5419
Disliked
Ido:
I test *10000 and /Point, the only diferency is in screen line ATR/HH%-LL% Range: Results is in pips (*10000) or in point (/Point)

Entry/TPs/Sl are correct anyway ever.

Mi brocker is Askobid, 5 digits.
dont understand were is the problem.
Ignored
OK, but why use /Point ? if i use *10000 i get 76.4 for example.
if i use /Point i get 764.0.
Maybe number doesn't matter, but i don't quite understand why /Point is better?
is for people who do not use 5digit brokers?

Also, spread wasn't working. will post tomorrow what i get... need some sleep now. need to work in 6 hours
  • Post #5
  • Quote
  • Feb 14, 2011 8:10pm Feb 14, 2011 8:10pm
  •  236dave
  • | Joined Jun 2010 | Status: Member | 107 Posts
Hopefully Easyrider will take a look over here.

I have been visually back testing with the indi's that were posted on Colostarr's thread. They have been a big help, thanks!

I have noticed that Easyriders indi picks most of the trade set ups, with the exception of when the setup bar makes the HH5 or LL5, irrespective of a Buy or Sell condition.

If I have read Colostarr's rules correctly, when in a Sell condition its ok for the setup bar to make the HH5, but not the LL5.

Likewise if in a Buy condition its ok for the setup bar to make the LL5, but not the HH5.

Easyrider, would you be able to revise your indicator in line with the above?
It would be much appreciated.
Attached Image (click to enlarge)
Click to Enlarge

Name: usdchfh4 small hours.gif
Size: 83 KB
  • Post #6
  • Quote
  • Feb 14, 2011 8:58pm Feb 14, 2011 8:58pm
  •  todd960960
  • | Joined Nov 2008 | Status: Member | 470 Posts
What is it that your using to determine if number '2' is red or green? I see sometimes when all rules are qualified to go long, but '2' is red. Such as GU right now.

1. HH5 is less then ATR
2. High of previous bar is less then High of previous 5 bars
3. Close of previous bar is > then 20sma or 40 sma.

So why is '2' red?

Also just to let you know, pairs with 2 or 3 digits before the decimal are all messed up. Not that it matters much to me. I just use this indicator as a quick visual reference.

thx,
todd
  • Post #7
  • Quote
  • Feb 14, 2011 9:24pm Feb 14, 2011 9:24pm
  •  forexgame
  • | Joined Feb 2011 | Status: Member | 20 Posts
Hi Ido,

Thanks again Ido for sharing the latest version of indicator. I believe this trading strategy introduced by Colostarr can be coded and transformed into EA. I hope I am able to contribute something here together with the coders in developing the EA/indicator. I have a couple of comments here which have already been posted to Colostarr http://www.forexfactory.com/showthre...76#post4398376 concerning with rule no. 2. I attached here the comments which I have been made.

Rule no. 2 is very hard to validate (refer here the 3 rules for this method http://www.forexfactory.com/showthre...=1#post4395337). Look at the set up for GBPJPY. I know GBPJPY is not your (Colostarr) favorite pair. I use this pair here is just for an example purposed only.

LL5 = 133.178
HH5 = 133.767
Low of the most recently closed candle = 133.462
High of the most recently closed candle = 133.749

Rule no. 2 states that

1. Sell set up: (Low of the most recently closed candle = 133.462) > (LL5 = 133.178)

2. Buy set up: (High of the most recently closed candle = 133.749) < (HH5 = 133.767)

So, which one is the right set up we want to choose ?????? We can choose both. Buy or Sell ?

Rules no. 1 & 3 are very straight forward. But be careful, rule no. 3 is quite hard too to validate when the close price of the recently closed candle is in between the 20SMA and 40SMA. What I can say, rule no. 3 depends on the rule no. 2. Above all here we need really to understand rule no. 2.

Thanks
Attached Image (click to enlarge)
Click to Enlarge

Name: gbpjpy.gif
Size: 26 KB
  • Post #8
  • Quote
  • Feb 14, 2011 9:43pm Feb 14, 2011 9:43pm
  •  forexgame
  • | Joined Feb 2011 | Status: Member | 20 Posts
Hi Ido & other coders,

Regarding with the indicator Small Hours, the TP1, TP2 and SL change with the current price. Could it be fixed according to the rules suggested by Colostarr i.e (copied from original thread).

Entry:
1.
Buy at the HH5 plus 3 pips plus the spread (open 2 trades)

2. Sell at the LL5 minus 3 pips minus the spread (open 2 trades)

Initial Stop loss:
1.
Buy: Set stop loss at the LL5 minus 3 pips, minus spread

Note: If TP’s or stops are not hit, change your stop after the close of each bar as follows: Move stop to the LL3 minus 3 pips, minus spread.
2. Sell: Set stop loss at the HH5 plus 3 pips, plus spread
Note: If TP’s or stops are not hit, change your stop after the close of each bar as follows: Move stop to the HH3 plus 3 pips, plus spread.


Target Profit’s (TP1, TP2):
Buy:
1. First TP is calculated by using entry price plus the value of ATR x .75
2. Second TP is calculated by using entry price plus the value of ATR x 1.5
When first profit target is hit, move stop loss on remaining order to break even. Continue to move stop to LL3 as new bars form.

Sell:
1.First TP is calculated by using entry price minus the value of ATR x .75
2.Second TP is calculated by using entry price minus the value of ATR x 1.5
When first profit target is hit, move stop loss on remaining order to break even. Continue to move stop to HH3 as new bars form.

It would be nice if the indicator can draw lines representing the entry price, TP1, TP2 and SL.


Thanks
forexgame
  • Post #9
  • Quote
  • Feb 14, 2011 9:52pm Feb 14, 2011 9:52pm
  •  todd960960
  • | Joined Nov 2008 | Status: Member | 470 Posts
I can see why we would 'add' the spread to buys, but I see no reason why we would 'minus' the spread for sells.

todd
  • Post #10
  • Quote
  • Feb 14, 2011 10:16pm Feb 14, 2011 10:16pm
  •  Phreddy
  • | Joined Sep 2007 | Status: Member | 373 Posts
So pleased to see this thread for those that are 'lazy' and want the machine to do the work for us.

I have great respect for Colostarr but don't agree with his insistance that I work it out for myself...each to his own.

Great respect for all the coders also. Probably even more because I have no idea what they are doing only the result

Having said that, here is the only post that I have understood
Quoting todd960960
Disliked
I can see why we would 'add' the spread to buys, but I see no reason why we would 'minus' the spread for sells. todd
Ignored
Better than that...I agree

My thanks to you all
  • Post #11
  • Quote
  • Feb 15, 2011 2:49am Feb 15, 2011 2:49am
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
Quoting todd960960
Disliked
What is it that your using to determine if number '2' is red or green? I see sometimes when all rules are qualified to go long, but '2' is red. Such as GU right now.

1. HH5 is less then ATR
2. High of previous bar is less then High of previous 5 bars
3. Close of previous bar is > then 20sma or 40 sma.

So why is '2' red?

Also just to let you know, pairs with 2 or 3 digits before the decimal are all messed up. Not that it matters much to me. I just use this indicator as a quick visual reference.

thx,
todd
Ignored
This is how the indicator looks like for me on USDJPY; what values do you get then?
Attached Image (click to enlarge)
Click to Enlarge

Name: Schermafbeelding 2011-02-15 om 08.43.28.png
Size: 33 KB


gonna change the number 2 i guess. maybe combine with rule 3 is a good option.
  • Post #12
  • Quote
  • Feb 15, 2011 3:21am Feb 15, 2011 3:21am
  •  Cashcalf
  • | Commercial Member | Joined Sep 2006 | 252 Posts
Quoting ido370
Disliked
This is how the indicator looks like for me on USDJPY; what values do you get then?
Attachment 640303

gonna change the number 2 i guess. maybe combine with rule 3 is a good option.
Ignored
Mine...
Attached Image
  • Post #13
  • Quote
  • Feb 15, 2011 4:00am Feb 15, 2011 4:00am
  •  Phreddy
  • | Joined Sep 2007 | Status: Member | 373 Posts
I have loaded the six majors as per Colostarr's view and here is the Usd/Yen picture. I would like to open up the spacing a little if I could.
I notice that my 2 and 3 are at odds with each other!! Not like Ido's, just like CashCalf!!
Attached Image
  • Post #14
  • Quote
  • Feb 15, 2011 8:27am Feb 15, 2011 8:27am
  •  howard
  • | Joined Sep 2006 | Status: howard | 1,664 Posts | Invisible
Quoting Phreddy
Disliked
I have loaded the six majors as per Colostarr's view and here is the Usd/Yen picture. I would like to open up the spacing a little if I could.
I notice that my 2 and 3 are at odds with each other!! Not like Ido's, just like CashCalf!!
Ignored
Also I note that on your chart TP1 is 100.0..... nd TP2 is 117.0... so they are not calculated correctly
Regards
  • Post #15
  • Quote
  • Feb 15, 2011 11:04am Feb 15, 2011 11:04am
  •  todd960960
  • | Joined Nov 2008 | Status: Member | 470 Posts
This is a bit later. But as you can see the TP calculations are way off.

And here's EJ. And yes I do have it on the daily.



Quoting ido370
Disliked
This is how the indicator looks like for me on USDJPY; what values do you get then?
Attachment 640303

gonna change the number 2 i guess. maybe combine with rule 3 is a good option.
Ignored
Attached Image (click to enlarge)
Click to Enlarge

Name: au010711buy0700am.gif
Size: 37 KB
  • Post #16
  • Quote
  • Feb 15, 2011 11:05am Feb 15, 2011 11:05am
  •  todd960960
  • | Joined Nov 2008 | Status: Member | 470 Posts
forgot ej
Attached Image (click to enlarge)
Click to Enlarge

Name: ej010711buy0700am.gif
Size: 39 KB
  • Post #17
  • Quote
  • Feb 15, 2011 11:10am Feb 15, 2011 11:10am
  •  todd960960
  • | Joined Nov 2008 | Status: Member | 470 Posts
Why is number '2' red?
Attached Image (click to enlarge)
Click to Enlarge

Name: guj010711buy0700am.gif
Size: 41 KB
  • Post #18
  • Quote
  • Edited at 1:27pm Feb 15, 2011 12:25pm | Edited at 1:27pm
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
OK, just got home from work. Meanwhile i changed the indicator for use with rule 1 and rule 3 only. Rule 2 doesn't make sense to, since both values are always true.
So rule 1 light goes orange if valid, rule 2 light goes green for buy, and red for sell setup.
I changed code to calculate TP levels back to *10000 instead of /Point (might fix your values todd960960?) . like it better this way. But of course feel free to change code to own liking, as long as you post your version back here

When both rules are valid, then lights will now be both in the same color too.

Attached File
File Type: mq4 Small Hours v2b.mq4   8 KB | 143 downloads

Attached Image
  • Post #19
  • Quote
  • Feb 15, 2011 12:30pm Feb 15, 2011 12:30pm
  •  james629
  • | Joined May 2010 | Status: Member | 27 Posts
can you add the arrow when to buy or sell too thanks ido
  • Post #20
  • Quote
  • Feb 15, 2011 1:44pm Feb 15, 2011 1:44pm
  •  ido370
  • | Joined Mar 2010 | Status: Member | 464 Posts
Quoting james629
Disliked
can you add the arrow when to buy or sell too thanks ido
Ignored
will look into that, have never done that before, so gonna catch up some reading & testing
  • Commercial Content
  • /
  • The Small Hours Simplified - Coding only
  • Reply to Thread
    • Page 1 23456 11
    • Page 1 234 11
0 traders viewing now
  • More
Top of Page
  • Facebook
  • Twitter
About FF
  • Mission
  • Products
  • User Guide
  • Media Kit
  • Blog
  • Contact
FF Products
  • Forums
  • Trades
  • Calendar
  • News
  • Market
  • Brokers
  • Trade Explorer
FF Website
  • Homepage
  • Search
  • Members
  • Report a Bug
Follow FF
  • Facebook
  • Twitter

FF Sister Sites:

  • Metals Mine
  • Energy EXCH
  • Crypto Craft

Forex Factory® is a brand of Fair Economy, Inc.

Terms of Service / ©2021