No offence, but I feel that the forex books out there are full of **********!!! One forex author talked about go fishing, another talked about wolves. Have not much idea and confused after reading them. But your ebook is so useful!!
They pumped up the number of pages by doing lots of analogy and stuffs, and if u really cut them down to useful pages, it probably less than 10 pages…
If u really want to publish it, your publisher might want you to pump it up?
It would be easy to modify your indicator into an EA. All you’d need to do is add a few lines of code.
You need something to compute the lot size, which it looks like you’ve already done in your new indicator, and then an if statement open an order when the price reaches the entry point.
Read up on the “OrderSend()” command. That’s all you need that you haven’t already done before!
Just stick something like this at the end of your indicator…
Of course you’d need another one for the short trade, and one for setting the trade to breakeven, but it shouldn’t be too hard. The hard and time consuming part is debugging and testing it before you use it with real money!
Looking at your code I can tell you are a much better programmer than I am! If I can learn to do it than you can do it better!
You’re probably right. I have 75 pages of real information, written in the same style as my ebook, and once I add in the pictures, charts, and diagrams it will probably be around 125-150 pages. I checked the forex books on Amazon and most are 250 pages or more.
There’s no way I could write that much about forex (trading really isn’t THAT complicated) without adding fluff, and I refuse to do that! My publisher gave me the names of two other publishers that I should send it too, and if they don’t like it as-is (which they probably won’t) then I’ll give it away here…
It’s no big deal to me since I’m writing it because I enjoy doing it, not to make a buck. But if a publisher will pay me a buck or two for it, I’m not going to refuse it!
We’d have multiple copies of the EA running on multiple charts at once, so you need something called a “magicnumber” so each EA knows which order belongs to it.
You have all your pairs assigned to a number…
if( Symbol() == "EURUSD" ) { Magic_Number = 4; }
Then you plug the Magic_Number variable into the proper place in the OrderSend() function.
int OrderSend( string symbol, int cmd, double volume, double price, int slippage, double stoploss, double takeprofit, string comment=NULL, int magic=0, datetime expiration=0, color arrow_color=CLR_NONE)
symbol - Symbol for trading.
cmd - Operation type. It can be any of the Trade operation enumeration.
volume - Number of lots.
price - Preferred price of the trade.
slippage - Maximum price slippage for buy or sell orders.
stoploss - Stop loss level.
takeprofit - Take profit level.
comment - Order comment text. Last part of the comment may be changed by server.
magic - Order magic number. May be used as user defined identifier.
expiration - Order expiration time (for pending orders only).
arrow_color - Color of the opening arrow on the chart. If parameter is missing or has CLR_NONE value opening arrow is not drawn on the chart.
seemed like just 2 lines of code, one for buy and one for sell
I don’t trust it to do my trading automatically, but I do trust it to figure my lot size and open a trade using a trading system that I know inside and out.
It’s not really the EA’s I don’t trust, it’s the trading strategies they use the things that programmers try to make them do… Like simulate human judgement.
With this EA I’d still be the one making the decisions, not the EA. I know when to turn it off. It’s a tool to help you trade, not a robot to trade for you!
going to draft out the program I am going to write an EA for,
find the closest sunday candle and draw a box and SL TP with it
=====> after this is done, do not do it again
=====> this should probably be put in the init module
if the Day=Monday, and 0100 hour candle is formed
=====> draw the box with SL and TP
=====> send buy and sell order; keep track of the TicketNumber
=====> set inMarket flag = true
if inMarket flag is true
=====> check if price reached BE for OSPBuy or OSPSell, if true, modify order’s SL to BE
=====> check if current ATR is more than 40% of the weekly ATR(14), if true, remove all pending orders
=====> check if Friday GMT 1200, close all inMarket Orders
Put that at the top of the code, make sure all the pairs you want are listed inthere, and then put the “_magicNumber” variable in the proper field in the OrderSend() function and you’re covered!
Most US brokers won’t let you set up both long and short limit orders at the same time now. A better solution might be to open a market order when the current price is >= (or <= for short) the entry price. Then no pending orders are needed.
It needs to be different for each symbol. Say you have 4 charts up with 4 different symbols, each running a copy of the EA.
If you close MT4 and then start it back up the EA’s will have no idea which order belongs to which EA. Ticket numbers will be useless because they were lost during the restart, but the magic numbers are attached to the order on the brokers side so they can always be used to tell which order belongs to which EA.