Showing posts with label MT4. Show all posts
Showing posts with label MT4. Show all posts

Sunday, April 27, 2014

Crossfader EA - Gold - Safety Lines

There have been many ideas tabled on saving the mighty trading account from CF when she turns against you. 

I have been using two charts with one set for buys and one set for sells.  The idea was that the sell trades could start even if the buys trades were active.  I was hoping to see the drawdown controlled.  Not sure why it doesn't work so well, I haven't spent much time examining that though.  Most likely because CF holds losers and take profits quick (no runners).

I had another brain fart the other day.  How can I manually control DD, and not sit and ‘hope’ price returns.  As I was looking through the sub-forums at SHF to decide where to post I ran across varso using a 45 pip stop (MPTM).  It seems to work for him.  My idea is almost the same!  We all know that trading with the trend is the way to go, but there are problems with that.  Which time frame is the trend you should be following?  The trend for CF should probably be the 240 or max the daily for a couple of reasons, first, CF uses a 240 stochastic, and second, when a basket starts, and depending on how many maxorder you are allowing, a price reversal could last a long long time.

Picture this - Price has been ranging on the daily for weeks and CF is happy to make Buys and Sells inside this daily range.  Now you enter a few trades, I've notice 4 to 6 in a ranging market on the 1 hour TF or 4 hour TF then price snaps against you.  CF enters more trades, price keeps ranging and snapping against you.  "Snapping" is the term I use when price surges in the direction of the trend.  In a downtrend, if you look at the chart you see price slowly drifting up, then all of a sudden it hits a level that everyone wants and BOOM, you have a lopsided market and price moves fast.So what I'm going to try is to limit drawdown by turning off Buys or Sells once price passes a certain spot or level. 
Here is the research I did to arrive at the solution.  I'm going to use AUDUSD charts as I have trades shown on it.  Now remember,  none of these trades had any drawdowns I couldn't deal with.  The trade starts are marked with lines
Here is the daily, notice the daily trend is strong down - didn't matter, CF made coin.  We'll zoom in after this chart.
audusddaily
Below is the hourly of the same pair
audusdh1
Both directions made money - look where the buys are made in this downtrend, pullbacks and consolidation.  If the pullback is weak or the consolidation not strong what happens?  You get hammered.
Here is a picture of what getting hammered looks like.
EURUSD Buys in a down trending market.  This is the hourly - clearly headed lower. Everything looks good until the recent buy, notice the pullback was weak and we get smashed.

 eurusd-h1-ava-financial-ltd-2
In this case - you could have drawn a line at the top of the range and call it "SellBelow", CF will only enter sell trade when price is under this line.  In my version, I will also add to the logic, once price goes over this line all sell orders will be closed.  Then get back to trading with a profit.
I don't know if this will work.  I've looked at the trades CF makes (myfxbook charts the trades) and this approach should work.  You could even follow the pivot points on the chart if you wanted too. 

How would I prevent this?  here is the idea.
Draw a line on the chart, a line in the sand.  Actually, draw 2 lines.  A green line and a red line.
Buys are only allowed ABOVE the green line, so you can trail it up if you want too.
Sells are only allowed BELOW the red line, you could trail this down if you wanted too.

One more thing - if there are open Buy orders and price drops below the green line, I close the basket.
So now I don’t have to worry about having two charts open, or having stupid large drawdowns.  You could even use SAR as your trend switch here instead of lines, SAR is more automatic.

Back to the first chart - where to put the lines?
On the downtrend, I plan to use the red line and the green line on a 1 hour chart to start.  The safe way to go in a downtrend, just turn off the Buy trades, chances are on your side that you wont get killed.  You wouldn't even need these lines.  

These are my Safety Lines.
So go ahead and draw the lines on the chart, the problem is if you change the timeframe CF needs to reload, I'm not sure if this is an issue or not.  Go to a 1 hour TF, put the red line above the high that price would have to get to and make the strong downtrend weak.
Here's an example (yes, hindsight is 20/20)
The red lines I show, the bottom right of each line is "when" I would move the line
The green lines - as soon as the Buy (long) trades are started, I would move the green line.  If you wanted “rules” – then as soon as the first trade is entered, draw a line.  You have lots of time to do it before you get smacked.
The yellow box below shows you the current Buy trades that are getting hammered, and where this system would have exited.
eurusd-h1-ava-financial-ltd-2-lines

If you are familiar with supply and demand you shouldn't have a problem with this.  I'm going to try this and I'll keep you posted.  I won't be near a computer for a few days, so don;'t expect quick replies!!!  The code is NOT finished yet, maybe by the end of the weekend.  I would like your thoughts on this method.

Tuesday, May 14, 2013

Hear the Market

A great way to study the market with the Market Pace indi.

This indicator was posted on FF and I've used it occasionally to "hear" the ticks. It's sort of like watching the level 2 screen but easier. Since SHF is where I usually go for forex related info, I thought I would post it there.
Set it up on a 1 minute chart and listen as price goes into supply and demand areas, or tests new highs and lows. It will sit there for a while then a big pop can be heard, the bigger the pop, the more points it just travelled.
As I don't tend to scalp very often I don't use this much but I do listen as I do other things sometimes. It sort of tells you when things are heating up....
If you scalp, you might want to try it out.
rooicol wrote this gem.  I you have issues installing there are a few posts on FF that might help. Some users have had difficulties getting the correct sounds to play. Read the instructions and the posts on FF if you have issues. Feel free to post questions here as there are many brains willing to help.
It's attached here so you don't have to go get it.

Friday, May 10, 2013

Drawing Levels on MT4

This is a new script I wrote and have been using.
TT2P_DrawLevels
Drag and drop the script to the top part of the level you want to identify and it will draw two horizontal lines from that point to the right of the chart. If you drop it above current price it's red, below is green. So post on page 18 for a picture. If you turn on "show object descriptions" in the chart properties, the level will also show the timeframe where you found the level.

Saturday, May 4, 2013

Money Management idea for MT4 EA’s

Lots of EA’s out there don’t place stops and the idea or risking a percentage of the balance isn’t really accurate.  So you leave yourself open to more risk.

Here’s an idea that might help assuming your EA is profitable.

When an account grows and the lot size is determined by the risk value, the lots can get too big. Then the account gets hammered.
I know when I would kick this in for a demo but for a real account, would you really let it trade 1 lot? Maybe, but this way you can adjust it to your own appetite. This also lets you not worry to much about making withdrawals on time to gain back your initial investment or monthly withdrawals.

If you want to see the system performance and not colour the results with MM, use a constant lot size. The equity curve should be a relatively straight line. Then you use MM to curve it upwards. BUT, don;'t use MT4 to do this, it's not of ANY use.
To test this, start a demo and use a low lot size that would be lower than if your set the risk to 10. I would do this but I don't have any space for more demos. I might, however, try this add on to one of my existing experiments....

Then add your max lot size code and do another test.

Friday, May 3, 2013

The Spread in Forex (MT4)

I’m testing an EA called Crossfader (CF), this post discussed the spread as it impacts that EA.

Spreads are more on the exotics, less on the majors.  This gets amplified in low liquidity  So, my thoughts on exotics and the spread.....

Firstly, the CF biotch works great with EURUSD, the most proven and reliable pair.  Hooking her up to an exotic?  Why would you do this (other than a demo as an experiment), are you looking for a hidden treasure, are you subconsciously trying to ruin your account?  That's purposely making your growth task much harder. 

Slapping this EA on exotics and trying to then fix it with filters is a waste of time and increases your risk, not to mention work load and stress level (if live, not sure anyone is doing this yet...)

If you're trading live or planning to trade live at some time,
I recommend slapping it on the 6 majors, on a demo account.  For analysing pairs.
Here's what I do, and consider I have a small nugget on a live test account with CF running;
Have 1 demo running 6 majors on all the time;

  • Risk 10
  • 100% DD
  • check each week and month for each pairs performance.  This will tell you what pairs to run live.  [*]On MyFxBook you can analyse by pair.
    Even put some additional pairs on it as you wish
  • The only purpose of this is to track pairs, not to see if the EA works or test DD or risk level, although you can glean some of this info from this demo

Spead Filters

  • Let's say you are running biotch CF on EURUSD only. 
    Do you need a spread filter?
    What number should it be set for?
    Should it stop entries or entries AND exits?
    Should it stop trading when spread is over or under your number (strange question right?)

When price is moving fast, like after a news event, is spread big or small?  small, sometime there is no spread as there are so many trades going on.

When it's off hours and price is standing still, no bidders want to hit the ask, no sellers want to pay the bid, what happens?  Large spread, price doesn't move, stalemate. 

How about just before a news release?  Wide spread, nobody wants to trade, they are waiting for the news.  The market is open, lots of participants right?  Nobody wants to trade. 

wide spread = nobody wants to trade

What happens during market hours when price runs into daily support / resistance level?  I bet most of you never watched a chart real time to see this....  As price approaches the level, you see many ticks, it slows as you arrive at the level, then you see nothing.... you check your internet connection, wtf?  I lost my feed... then you see TICK....  the spread widens.  This is where you want to enter or exit, a turning point possibly, or a breakout. 
Don't believe me? 
Run a spread recorder, install the market pace indicator so you can "hear" the market, and watch price on a 1 minute chart.  Mark off area where price stalls. 

Market pace is a nice piece - when price is moving slowly you hear a low volume tick pop sound.  when price is at a level and stall, let's say price is rising, hits a level and stops.  After about 30 seconds price will go down by the value of the wide spread, this larger movement makes a louder sound POP!!!  It really is neat to watch this, it may help you understand the auction process.

Back to the questions above -

  • Do you need a spread filter?  entries, probably not if you turn the EA on for liquid session and use one of the majors. 
    What number should it be set for?  use the spread recorder to find the right number.
    Should it stop entries or entries AND exits? Probably both - apart from off market hours increasing spread, there are S/R areas and news events that increase spreads and I don't want to trade at that time, BUT - to get out of a trade at  the profit level and worry about another pip, that doesn't concern me.
    Should it stop trading when spread is over or under your number (strange question right?)  This was the point of this post, now your thinking maybe I should enter when the spread is big during market hours?  You must figure this one out on your own. 

What am I doing?  I'm adding a spread filter that just takes out the really stupid spreads, for example, EURUSD would not allow entry or exit on a spread of more than 4 pips.  (that's actual pips, not fractional pips).  Exotics, not trading them, those pairs are there for companies that do business in other countries, not for traders.)

Thursday, August 30, 2012

How to program AFL in Amibroker and MQL for MT4

I’m a self taught programmer, the only classes I ever took part in were in high school.  Back in the day of the cards – you had to use a pencil on some cards then feed them into a machine and it ran your program.  I learned Fortran first.  Then a tried basic language on a Commodore 64 or something, long time ago, can’t remember the details.

If you want to learn Amibrokers AFL or MT4 here are a few suggestions:

Take a night course in programming, not sure which language is close to either of these but if you ask in some forums or Google for similarities you’ll find answer.  If you already know a language, don’t bother with school, jump to step 2.  

You first need to learn logic flow and what functions are and what object programming means, your looking learn to the concept of programming and how you write a program, run it, and debug it.  Then you can cross utilise this skill with any other language.  It takes some self learning. 

The next step, load up a small program and try to understand it. If you put your cursor on a function (which usually highlighted in blue) and press F1 help opens up and you can read about the function.  Then read the help docs on program flow to understand how the program executes. 

Next – load up a bigger program and understand the flow.  Make some small changes, maybe try to print stuff to the screen or alerts menu, or send en email. 

Next – read a tutorial, free one are always offered on line.  You can start with this as step one as well but after you play with code you should go back to a tutorial and read it again.  Read the tutorial once a week for 3 weeks, read it to understand it.  Read it when the kids are in bed, you need to focus un-interrupted.

Next – have an idea of what you want to do, then steel some code as a starting point and modify it to suit your coding goal.  here’s an example.  Load up the stochastic indi.  Make an indicator in one single window with 3 stochastic, with either K or D.  Set them to 8, 21, and 55 periods.  Run it on a 15 minute timeframe.  Now add another that is set to a forced time frame of 4 hours and is an average of the 8, 21, and 55 periods.  Plot the four lines.  Use the same colour for the 15 minute and a thicker and different color for the 4 hour.

Then, ask yourself this – am I coding because I like it and trading is secondary, or am I coding for a purpose? I got into the rut of coding because it was a challenge. I wasn’t learning to trade.  Then I decided to just watch the screen and price action and learn to trade. Then code for what I wanted to do.

And the best for last – I don’t think I have ever written a program from scratch – I always start with something that has been done already, then change it, add to it, delete stuff, and make adjustments.  After a while there might not be anything left of the original, but it sure make it easier to start.

Tuesday, August 28, 2012

Canadian Forex Accounts

If you have the option to open an account in Canada for Forex, you will gain a great protection plan!

IIROC is the regulator in Canada, here's the blurb from there site.

Investment dealer insolvency doesn’t happen very often, but if it does, the Canadian Investor Protection Fund (CIPF) is here to ensure your cash and securities are returned to you, within defined limits.

If you have an account with a CIPF Member you have CIPF protection - coverage is automatic for all eligible customers. For more information, go directly to our Coverage Policy.CIPF is sponsored by the Investment Industry Regulatory Organization of Canada (IIROC) and is the only compensation fund approved by the Canadian Securities Administrators for IIROC Dealer Members. All IIROC Dealer Members are CIPF Members.

So, for anyone outside of Canada, take a look at this page.... it tells you what and who is covered under CIPF. http://www.cipf.ca/Public/CIPFCoverage/ ... olicy.aspx

The sad part for US residents is that the Canadian regulator respects the US regulaor.  US regulator does not allow US residents from opening accounts outside the US.

From the CIPF web site

Question: Does it matter if I do not live in Canada, or if I am not a Canadian citizen or a Canadian resident?

Answer: No. CIPF coverage does not depend upon residency or citizenship. CIPF coverage is available to you when you open an account with a CIPF Member.

Canadian Brokers offering MT4


FXCM uses a company called Friedburg Direct.  I have an account with them.  Here is the MT4 FXCM page.
Over 5K you also get a free VPS. 1:50 leverage - and that's OK with me!! 


I know that Questrade is going to be introducing MT4 some time in the near future. 


Forex.com (Gain Capitol) - good spreads. free VPS with 5K or more.

Tuesday, February 28, 2012

The Sound of Price

I tried this script and got it working.  You hear popping sounds as the ticks come into your MT4 platform.  For you price watchers, would you ever try this out?  Do you think its of any use?  In the evening I tried this out and it serves a purpose in my view if you're looking to scalp of looking for a breakout on a small time frame.


Hope you comment!


Read this post at forex factory on The Sound of Price

Tuesday, December 27, 2011

Tipster Trendlines for MT4 – NEW


If your looking for an EA to help you place your manual entries, exits, targets and so forth, here is one that I just posted.  All you have to do is load the EA and it draws lines for you, just move them around and start the EA.  Here’s an excerpt from the manual that is posted with the EA file.
Introduction
I wrote this EA to be able to place my manual trades easily, avoid errors, and let the computer do the repetitive tasks. If you enter trades manually this EA should help you.
I use EA robots as well as enter manual trades based on price action. This EA can be used on the same platform as other robots, just make sure the Magic Numbers (MN) are different. This EA also used Magic Number to track, so ensure your broker let’s you use MN’s. Order comments are used but not required. Brokers such as Oanda do not let you use MN’s, and the comment field is filled out by them so be careful, run this on a demo account first to ensure it works as expected.
This document will only discuss the 2P version, the 1P is very similar.
Functionality
To setup an order, you need to place the 5 lines on the chart to a valid location (Entry, Stop, Target 1, Target 2, BreakEven), then go to Expert Advisors Properties and set LimitOrder to true or false. The EA will display the order type on the lower left of the chart, check it before you set “Live” to ‘true’ in EA Properties. Lines can be horizontal or sloped.
The EA determines the type of order based on the location of the lines relative to each other and current price. Note: If the ticket numbers (generate by MT4) are not sequential a pop up box will appear, you can select to delete the orders. If the order ticket numbers are not sequential, the EA cannot manage the trade properly.
Placing a Trade
Here’s a quick run through of how a typical trade set-up is accomplished once the EA is on the chart and MT4 is set up as described above.
1. Set up the lines.
2. Turn on the EA, EA properties à Live = “true”, LimitOrder = “true of false”
3. Price is not between the dashed blue buffer line and the blue entry line, the bottom left on the screen says “+LIVE+ …waiting. Sell Stop order set”.
4. Price is now between the two lines described above, two orders are sent to the broker (pending limit orders), and the only difference is the targets. The bottom left of the screen says “+LIVE+ <<PENDING ORDER>> Sell Stop order for 0.10 lots
5. The target for the second order is always closest to the entry, the EA takes care of this, even when you move the lines around when the trade is open. This is done so it can track the single remaining order once the first target is hit. When you have a pending order (not filled) you can drag the lines around. Note that the lines cannot be on top of each other, the EA keeps them slightly apart so you can grab them.
6. When price hits the entry line you are now in a position, you can drag the lines around. Be careful not to drag the targets or stops to close to current price or your position could be closed unexpectedly. Sometimes it’s a good idea to make Live = false and adjust the lines up, then turn it back on. You can also use the “Expert Advisor” button on the MT4 menu area.
7. A screen capture image is stored in /experts/files/ with the filename that shows the symbol, ticket number, etc so you can figure out what the trade setup was when you look at the picture in the future. Images are captured so you can review your trades later to see what you can improve upon.
8. After price hits a target one order is closed and the other is tracked by the EA as long as it is on and running. If you used horizontal lined you can turn the EA off. If you used sloping lines you need to leave it on so it will update the new order details as new bars open.
9. Once both positions are closed an image capture is stored in /experts/files/
10. To reset the EA you can just delete one of the lines, the line will be re-drawn and the EA will be ready to go again. The best method however, is to got o EA properties, “Reset”, then right click on the chart to “Objects”, CNTL A to select all, then “Delete”. Another way is to use the TipsterDelete script that will clear the screen.
11. Press Q and P at the same time to move the stop back to the red stop line. The EA will only move the stop towards profit and won’t let you move it away unless you press Q and P, then a pop up message appears. For this functionality to work, you must enable dll’s, and live trading.

The link is at the top of the blog.  Or you can search on MQL5.com.

Disclaimer

The information presented on this site is for educational and entertainment purposes only. This site contains no suggestions or instructions that you must follow, do your own research and due diligence before committing your cash to the markets. Your on your own.