- Search Energy EXCH
-
kennyhubbard replied Oct 7, 2010int start() { if(New_Bar())Make_Trade() ......do other stuff } //------------------------------------------------------+ bool New_Bar() { static datetime New_Time=0; if(New_Time!=Time[0]){ New_Time=Time[0]; return(true); } return(false); }
Help with logic for only hitting one order per bar
-
kennyhubbard replied Sep 25, 2010Don't worry guys, we will make an EA of this yet. The difficult thing with this EA is actually just trying to determine which round number was crossed last by the price action. You can see it on a chart, but to code it is a tad more difficult than ...
An idea for a profitable EA
-
kennyhubbard replied Sep 24, 2010Ah, yeah, good work......much neater ;-)
Coding to reformat dollars - 1234567.89 to 1,234,567.89 ?
-
kennyhubbard replied Sep 24, 2010No built in format, but here is some code for you to use....... //+------------------------------------------------------------------+ //| Test.mq4 | //| Copyright
2010, Kenny Hubbard | //| url | ...Coding to reformat dollars - 1234567.89 to 1,234,567.89 ?
-
kennyhubbard replied Sep 22, 2010Nope, its not locked.....I don't think you can lock a mql4 file.
An idea for a profitable EA
-
kennyhubbard replied Sep 21, 2010Ok, wait, I think I see what you are talking about. I will have to go figure out how to implement the first step. Gimme a couple of days.
An idea for a profitable EA
-
kennyhubbard replied Sep 21, 2010Not quite following you............the EA makes 2 stop orders. It looks at the current price and makes a sell stop at the first RN below and a buy stop at the first RN above. On my system it does not make another pending trade until the previous ...
An idea for a profitable EA
-
kennyhubbard replied Sep 20, 2010Yup, it should work with an ECN broker. Stop Orders can be entered with a SL & TP, unlike market orders.
An idea for a profitable EA
-
kennyhubbard replied Sep 20, 2010Here you go.... — Hi guys, Try this........
An idea for a profitable EA
-
kennyhubbard replied Sep 16, 2010Mike, Here is a sample code :- bool result; while(OrdersTotal() > 0){ RefreshRates(); OrderSelect(0,SELECT_BY_POS); if(OrderType()<2)result = OrderClose(OrderTicket(),OrderLots(),OrderClosePrice(),3,CLR_NONE); else result = ...
Simple close script - some help with code needed
-
kennyhubbard replied Sep 14, 2010New Version 6 — Hi guys, Herewith version 6. The main difference is the addition of a custom Stop Level, so you can have the EA modify the trail every 0.5 or 1 pips instead of on each tick. This will also function as a jumping stop for those ...
I'm seeking a trailing stop EA that surely must exist, any ideas?
-
kennyhubbard replied Sep 14, 2010Here you go. It runs only once in the init function, so it does not change on a daily basis to reflect changes. Its an indicator, so place in the indicator folder.
Indicator showing Swap Rates?
-
kennyhubbard replied Sep 10, 2010Well, I have to confess that I am stumped. I can't see anything obviously wrong. Did you check the logs and are you certain it was this EA that closed the incorrect trade. I think the best will be to work in some Print() statements, so you can ...
Programming Help
-
kennyhubbard replied Sep 10, 2010No real problem with closing out in a loop, but it must be done counting down because the OrdersTotal() variable changes with each order that closes, so you are effectively changing your exit condition with each closed order = chaos. I think I ...
Programming Help
-
kennyhubbard replied Sep 10, 2010Hi Scooby, Not sure that is the problem. The computer uniquely identifies where it is in the loop and will look after its own loop within the subroutine. I can see the EA spitting out some error with the first loop that counts up.....possibly not ...
Programming Help
-
kennyhubbard replied Sep 10, 2010Scooby, you probably going to have to provide more info than that. Off the top of my head, are you trying to use ProfitPerTrade as a %(dividing by 100?)? Also, is the ProfitPerTrade a double with global scope? Also, what is the routine doing? Mot ...
Programming Help
-
kennyhubbard replied Sep 10, 2010Peter, Between the Terminal logs(journal) and the Expert logs(experts tab) you will find the answers. I disagree about the capacity issue. 20 EA's over 4 terminals is not an issue. I routinely run 3x or more than that. I have one EA that I use on 3 ...
MT4 Problem - Opening a Deal, then Closing it again straight away
-
kennyhubbard replied Sep 10, 2010Peter, Pehaps you should post the text logs of the 3 other Experts tabs....and the Journals. The answers might be in those.
MT4 Problem - Opening a Deal, then Closing it again straight away
-
kennyhubbard replied Sep 2, 2010What you are wanting is the EA option. The only way to run this as a script would be using an infinite loop.......but if you can't get the EA to work, you won't get it to work as a script. Simply run the code in an EA on every new bar and place it ...
Run a script each XX minutes