- Search Energy EXCH
-
tomhliles replied Dec 5, 2009void is simpler the void isnt returning anything, but you can still change variables that are global to the ea, such as the buys, sells all i ever need is the void other types can be used but you need return() because thats the value returned ...
Coding Tutorial
-
tomhliles replied Dec 4, 2009heres a tutorial i started youl find a solution there url
A little input would be appreciated :-)
-
tomhliles replied Dec 2, 2009i found a few dumb errors you can compare this to yours, theres a error in both of the for's and in the global variable delete just under orders(); in the start function there fixed in this version
Coding Tutorial
-
tomhliles replied Dec 2, 2009this ea can now be used to trade, or test manual trading in tester feel free to ask any questions
Coding Tutorial
-
tomhliles replied Dec 2, 2009now we need a sell script we also need a close script its unlimited the scripts we can make, from pending orders, to using a sl to calculate lot size we can even build in risk to reward ratios lets add a close function while i was making the close ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009now lets edit a few things, for starters, lets make the lot size show up in the ea properties at the top, put this extern double lots=0.01; now in the ordersend function, replace 0.01 with lots like this if ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009i just had a realy good ideah heres the new plan were gonna make this ea trade in tester, using scripts, which use global variables that means during a visual mode test, we can drag n drop scripts to the chart to trade wel finish the ea, then wel ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009im going to code this ea in a way, that adding indicators is pretty much unlimited a couple years ago, i ran into the problem of many conditions to concider when i was novice (copy n paste n edit coder) i couldnt code over 3 indies, because i though ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009your probably already getting good enough to add things on your own lets add profit to the counting at the top add this to the doubles profit should look like this double buy_lots,sell_lots,profit; also reset it to 0 and heres what iv done ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009lets add to the orders function might as well improve it first thing i see, i can make it look cleaner void orders() { buys=0; sells=0; for(int i=OrdersTotal();i>=0;i--) { OrderSelect(i, SELECT_BY_POS); if ( OrderType() == OP_BUY) { buys=buys+1; } ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009how to trouble shoot if you ever get a error that says zero divided or your ea just isnt doing what you expected use the Print() feature it will print in the journal, anything you want example Print("testing"); or print a value Print(buys); or value ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009some things are pre defined, mt4 knows there value, such as things like this Ordertype() Accountbalance() Bid Ask Close[0] Open[0] i completely taught my self with the help system in editor lets say youd like to code a moving average in a box to the ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009now the ea will know how many orders we have id like to show you a diferent way, so were gonna move the code to outside the start() at the very very bottom add this void orders() { } now cut n paste the code in the start() and put it inside that ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009im trying to think of something we can make this ea do iv decided to add a function that counts orders iml have to go into the for operator to do this the for operator will loop until the condition becomes false for(int i=OrdersTotal();i>=0;i--) { ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009youv been seeing alot of these ; that must end things, if 1 of them is missing, you will get a error if is a statement, were gonna just stick to it for a while we can accomplish a lot with just the if statement next thing is the variables, for now, ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009check this out if (something) notice theres no brackets? what will happen now, is that rule will apply to what ever is next, and only that one single next thing if (something)blah=0; or if (something) blah=0; you should be noticing by now that ...
Coding Tutorial
-
tomhliles replied Dec 1, 2009first thing to know, is how {these brackets work} lets imaging our program is a building, the building has many floors we must be back on the ground floor to get out heres the basic structure of a function a function does something, or returns some ...
Coding Tutorial