Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

BlueHorseshoe

Market Wizard
  • Content Count

    1399
  • Joined

  • Last visited

Everything posted by BlueHorseshoe

  1. What you have done with your first example code should work. There is no need for the parentheses. So the following works fine: If t>=0800 and t<=1600 and c crosses over average(c,50) then buy this bar; Setexitonclose; Try running this code and see if it works for you. Then change the necessary conditions for entry and refine your exit. Let me know how you get on. Regards, BlueHorseshoe
  2. You just need to replace the 1 with the variable. vars:n(0); n={define value}; Buy next bar at PivotHigh+n stop; Regards, BlueHorseshoe
  3. Hi Siuya, I was basically wondering what happens if a position is established in the same way as for dividend capture, but is then allowed to run, using the captured dividend as a backstop on the position. Basically, a trend-following strategy that uses the dividends to "insure" the stopped out trades. If what MM describes is correct, then this wouldn't really work. I like your suggestion of looking for stocks that decline by a greater amount than their dividend though . . . Cheers, BlueHorseshoe
  4. Thanks. And I guess the standard dividend capture strategy doesn't have this issue because there's no stop (and massive risk)? I think I'll stick with letting the dividends drip into the account and treat them as nice bonus rather than trying to get smart! Cheers, BlueHorseshoe
  5. Why focus on dividend capture? If stocks regularly fail to fall by the dividend amount on the ex date, why not aim to capture an outsized return from price gain rather than just the dividend? BlueHorseshoe
  6. I'm relatively new to ETFs and haven't paid dividends too much attention, but I'm just pondering the following hypothetical idea . . . 1) buy an ETF in time to qualify for the dividend 2) set a stoploss equal to the amount of the dividend payment less my costs This should then give me a completely "free" trade. The trade will have zero downside and unlimited upside. Providing outsized moves with low MAEs occur with sufficient regularity (as the likes of Taleb would have me believe), then I should make money. But unlike the options buyer, my downside is limited to zero, and the dividend has not been carefully "priced" in the way that an option premium has to negate my opportunity to profit (assuming the options pricing formula is valid). What blindingly obvious thing am I missing here? BlueHorseshoe
  7. BlueHorseshoe

    RISK

    I'm going to be contrarian, and suggest that what you're talking about here isn't really risk. Here in the UK (and I imagine the US is the same as it's litigation-central) we have things called 'Risk Assessments'. These are basically bits of paper where all the 'risks' associated with an activity are listed, and measures to 'control' them are described. I was recently discussing this with someone who works in the outdoors industry taking people up mountains. She has lots of risk assessments. My argument is that once you identify and find a measure to mitigate it, it isn't risk. Risk is the curveball. The deus ex machina. Risk is when you've identified all the dangers of dehydration, hypothermia, and trips and falls on a mountain climb, and everything feels safe, and then a spear of frozen urine ejected from the toilet of a passing overhead plane plunges straight through the top of your skull. That's risk! The unpredictable. Taleb cites the following more realistic example . . . Consider yourself responsible for controlling risk for a Vegas casino. What are you going to do? You'll want great security, cameras everywhere so you can see what's going on, maybe detectors to stop people using concealed computers, highly trained crupiers who can spot card counters a mile off, a list of well known con artists and career gamblers . . . You get the picture. These are the kind of problems you can see, predict, and try to control. If you do them well you'll probably convince a pedestrian insurer that you've controlled the major risks. The three biggest financial losses to casinos in the history of Vegas? - When that magician got mauled by his pet tiger and sued the casino. - When the casino owner embezzled the casino's own money to pay ransom on his kidnapped daughter. - When a disgruntled former employee decided to rig the parking lot with explosives. Once again, that's risk! And managing it is, by definition, very difficult indeed . . . BlueHorseshoe
  8. Hello, You can do things like: if c[0]>o[0] and c[1]>o[1] then buy next bar at market; or if c[0]>o[0] and c[1]>o[1] then sellshort next bar at c-range stop; the current bar is numbered zero, so the prior bar's open would be open[1]; or just o[1]; you can use market, stop, and limit orders for entry. you can either create a full blown instruction (as with the entries) for exits, or you can just specify a dollar stop and profit target: setstoploss(200); setprofittarget(500); Hope that helps! BlueHorseshoe
  9. Also bear in mind that the 1% rule (otherwise known as 'fixed fractional') has developed more from the leveraged futures industry (look at the Turtles, for example). It's not necessarily relevant to what you're doing with stocks if you trade without leverage. For instance, if you're trading the ES on a $5k account, then a 100 point adverse movement will wipe your account out. If you're trading the SPY exchange traded fund with no leverage and all your equity invested, then it would require a 100% adverse movement (ie the whole index goes to zero) to wipe your account out. So whether you use leverage or not tends to make a difference to how you should size positions. Hope that helps! BlueHorseshoe
  10. Hmm . . . I just have a word document that contains a table with all the passwords in. It has never let me down and didn't cost me £30 My pet peeve is people who lead overcomplicated lives. Late last year I even bought an old alarm clock and ditched my mobile phone. I spend enough time that is compulsory staring at electronic gadgets - I don't want to have to deal with them in my free time also. Have you seen 'Skyfall' (I don't work for EON Productions or MGM )? There's a great line about shaving with a cut-throat razor - "sometimes the old ways are the best". . . Thanks for sharing though! Kind regards, BlueHorseshoe
  11. Hello, I am unclear what your question is. Are you asking how to place an order using easylanguage, or how to trade using renko bars (strategy ideas etc)? Regards, BlueHorseshoe
  12. Gavin Holmes from Tradeguider (assuming you're not really Gavin) will tell you any crap it takes to get you to buy stuff from him. Read post number 5 by UrmaBlume in this thread: http://www.traderslaboratory.com/forums/beginners-forum/17853-i-am-not-rich-do-i.html#post190640 Do you really think that the simplistic nonsense that Gavin pedals is going to help you to take money off these quys? Do you honestly think that if Gavin could make a living from daytrading he would be wasting his time with an education company, and all the associated hassle of dealing with the public? Do you have any inkling of how sophisticated the counterparties to yours and Gavin's trades (if he actually trades) are? Gavin used to run VSA seminars for Infinity Futures - why is he now telling you to avoid futures volume? If you're not just a shill then I urge you to avoid Tradeguider and all similar companies like the plague - you'll have lucky spells, but eventually you'll lose all your money. BlueHorseshoe
  13. Hi Jacare, Here we go: if v>100000 then plot1(0) else noplot(1); You'll need to go into the indicator's settings and change the plot type to dots. Hope that helps, BlueHorseshoe
  14. The goal for me was to try and smooth the equity curve without significantly reducing the number of trading opportunities and hence the net profit. In other words, I wanted to strike a balance between the two. The answer seems to be to adjust the position size down rather than throw a trade out all together when some condition such as volatility doesn't look the way you want it to. Yep - it only ever gets more complicated! But remember, with any of the approaches above, your maximum position size will still be no greater than what you would have used anyway. For a trend follower, though, my OP would be of no value for the following reason: as a trend follower most of your profits come from outliers, and these trades will typically be many multiples of the average trade in duration (the average trade will be a loser), and also span numerous volatility cycles. It's also safe to say that the further out you go, the less accurate your prediction of volatility is likely to be. The best predictor of future volatility over a longer time period is almost always . . . current volatility. Which is exactly what the Turtle method uses And, I'm guessing, the simpler option pricing models? Do the large trend-following funds get around this by constantly rebalancing against shorter term volatility predictions? I don't know the answer to this. Shhh! That's meant to be a secret - otherwise what will all those PhDs do for a living? You're clearly talking about a discretionary element here, based on your fundamental understanding of a market. If you have this then it probably makes life much easier, but if you don't then can someone quantify your statement? Assuming you expect volatility to follow a predictive model, and the further from the model it strays the less confidence you have in understanding what's happening, then you could do something like the following: A market's volatility is increasing by 5 per day. Your model makes a simple linear projection and expects that it will continue to increase by 5 tomorrow. As long as it does this then you "understand" the increase and can trade with perfect confidence at the end of tomorrow with your default size of 100 units. At the end of tomorrow you obtain your "Understanding Weighting" by calculating the deviation from the expected volatility, where a 100% deviation (ie 10 or 0 increase) gives a zero weight and a 0% deviation (ie 5 increase) gives a weight of 1. When volatility at the end of tomorrow turns out to have increased by 3.68%, your Understanding Weighting = 3.68/5 = 0.736, so you trade with 0.736 * 100 = 73 units. If volatility at the end of tomorrow increased by 6.32% then Understanding Weighting = 1-((6.32-5)/5) = 0.736, so you trade with 0.736 * 100 = 73 units. Before anyone points it out - yes, I am consumed by an unhealthy need to quantify and control everything! Regards, BlueHorseshoe
  15. Hi MidKnight, Glad you found the post interesting! As far as any of it goes, this relies on being able to work out where you are within a volatility cycle, and how well your strategy's typical trade length is aligned to the cycle. For daytraders the cycles generally seem to be more erratic - volatility tends to increase sharply during the first few minutes of trading, completely regardless of how it was unfolding up to that point - no simple geometric projection model is going to predict this. So I would agree that it is probably significantly easier to find an application for this as a swing trader. Best wishes to you for the New Year also! Kind regards, BlueHorseshoe
  16. Hello, I thought it would be interesting to hear people's thoughts on the following . . . Last spring I spent some time investigating volatility and position sizing. Previously I had made myself familiar with the approach of the Turtles - when volatility is high, then the same dollar movement can be achieved by holding fewer contracts; smaller positions are used in high volatility and larger positions are established in low volatility in order to normalize losses and gains. The obvious problem with this is that 'volatility' is measured at the time the position is established. What bearing does this have on the volatility over the duration of the trade? The first thing I did was to feed an output from my strategy - the cumulative average trade length - back into the strategy as an input (an extremely simple instance of machine learning). This meant that volatility was measured in terms of the life of an average trade, rather than using some arbitrary/optimized parameter. At the time a position is established, however, this new adaptive measure was still only telling me something about historical volatility (albeit over a more relevant time period). What I was really interested in was anticipating the volatility that was yet to come, during the time that I would be holding a position. Predicting volatility is obviously very difficult - I imagine quant firms involved in option pricing probably spend a lot of time working in this area. What I found can be summarized as follows: Volatility is typically cyclical and oscillates around its mean. Where the time between peaks and troughs in this oscillation is roughly equal to the average trade length of a strategy, then it makes sense to do the precise opposite of what the Turtles did. This means that when volatility is high, a larger position size should be used, in the anticipation that volatility will fall over the duration of the trade. Likewise, when volatility is low a smaller position size should be used. One of the problems with this is when volatility is high and a large position is taken, but also continues to increase throughout the course of the trade. And the solution to this problem must be that the baseline from which 'large' and 'small' position sizes are derived must not be equal to the maximum position size that is allowed by the primary money management formula. Rather, the 'large' position size should be equal to this maximum, with all lesser sizes scaled using a ratio determined by the trader. How to do this? Here is a simple example to begin with: You are trading a single stock, with zero leverage. It is priced at $100, your account size is $100000, and you will risk no more than 10% of your account on it. This means that, using fixed-fractional as your BASELINE position size, you can buy (100000*0.1)/100 shares. BASELINE=100. We will assume that the TYPICAL position size is half of the BASELINE, so TYPICAL=BASELINE*0.5=50. The cumulative average volatility - CAVGVOL - for the instrument is, say, 30. The TYPICAL position size is aligned with the CAVGVOL. So when the predicted volatility PVOL=30, POSITIONSIZE=TYPICAL. When PVOL=15, POSITIONSIZE=TYPICAL*(1/(PVOL/CAVGVOL)) Or . . . POSITIONSIZE=50*(1/(15/30))=100 This makes perfect sense - when the volatility is half the average, we need to hold twice as many shares to achieve the same gain as when volatility is average. An obvious problem jumps out here - what happens when volatility is less than 50% of the average volatility (ie PVOL<CAVGVOL/2)? This would require us to hold more than the BASELINE number of shares, and the BASELINE is the maximum number of shares that our underlying money management formula permits. One solution is simply to take the lesser of the two values as a new variable - in code this might look something like: possize=minlist(positionsize,getequity/c); This creates a very defensive stance, whereby we will decrease the number of contracts indefinitely when we expect high volatility, but we will never increase them above the maximum our money management formula allows, no matter how low we think volatility will become. It is of course possible to set the value for TYPICAL as a fraction of BASELINE that allows for PVOL values of 100% less than CAVGVOL. A more symmetric (though by no means better) approach is as follows: Volatility cannot fall below zero, nor we will assume below 1, so the largest increase in the number shares we can ever expect is 1/(PVOL/CAVGVOL)*TYPICAL. This would require us to hold 1/(1/30)*50=1500 shares. When this maximum increase occurs, we want it to be equal to the BASELINE number of shares (the maximum our underlying money management formula allows). So, we want it to be possible to increase our TYPICAL position size to be 30 times greater to match the BASELINE. TYPICAL would therefore be equal to BASELINE/CAVGVOL=100/30=3.3 shares. For a trade where we expect average volatility, we want to trade 0.33 times the BASELINE number of shares. In instances where volatility drops to 1, this will allow us to increase the number of shares we trade to ensure that our gain is always normalized against the gain of an average volatility trade. Another problem has now arisen . . . Unless we happen to be trading a very large account, our scope for reducing the number of shares is somewhat limited! This problem is not mathematical, it's caused by the 'granularity' of the share price relative to the account size, and the fact that we're trying to arrange things around a central value when the underlying input is unbounded on one side. Here is a different way of doing things that deals with this to a reasonable extent: MAXVOL is the maximum recorded volatility, and MINVOL is the minimum recorded volatility. All PVOL values must exist within the space bounded by these two values. This space is aligned with the space between zero and the BASELINE value. So if we assume the lowest volatility recorded is 25 and the highest volatility recorded is 35, then we can locate a PVOL of 32 in terms of these values as (PVOL-MINVOL)/(MAXVOL-MINVOL)=(32-25)/(35-25)=0.7. SCALEDVOL, as we shall call it, is 0.7, or 70% of the max/min range of recorded volatilities. When SCALEDVOL is 0 we want to trade with our largest position size, equal to BASELINE. And when SCALEDVOL is 1 we want to trade with our smallest position size, a factor of BASELINE which we will call MINSIZE (In effect, MINSIZE*BASELINE is equivalent to TYPICAL-(BASELINE-TYPICAL) in our previous formulation, or -93.4). We will set MINSIZE at 0.5. So for our SCALEDVOL of 0.7, we want to trade (BASELINE-(BASELINE*MINSIZE))*(1+(1-SCALEDVOL)) . . . or . . . (100-(100*0.5))*(1+(1-0.7))=50*1.3=65 shares. For a SCALEDVOL of 0.2 we want to trade (100-(100*0.5))*(1+(1-0.2))=50*1.8=90 shares. For a SCALEDVOL of 1 we want to trade (100-100*0.5))*(1+(1-1))=50*1=50 shares. For a SCALEDVOL of 0 we want to trade (100-100*0.5))*(1+(1-0))=50*2=100 shares. There is just one final thing to consider, and that is how to deal with situations where the predicted volatility PVOL is greater or less than the historical MAXVOL and MINVOL. Once the strategy has a reasonable amount of data under its belt this won't happen often, but it will happen. My solution was simply to throttle these values by passing SCALEDVOL through a sigmoid function. This is a bit of a hassle in TradeStation as it only offers the hyperbolic tangent, so you need to do something like the following: throttle=((tanh((scaledvalue*2)-1))/2)+0.5; Note that this will also begin to compress any SCALEDVOL as it approaches MINVOL or MAXVOL, meaning that less credence is given to the reliability of extreme PVOL values - probably a good thing as all extreme values tend to revert to the mean in subsequent periods. I am interested to know what everyone makes of this approach. Would you want to increase position size when volatility is high? Is this a good way to do so whilst maintaining control of risk within clear parameters? Kind regards, BlueHorseshoe
  17. Hello, Position-sizing is probably the answer. If you're daytrading, then as the post above points out, volatility is your friend. You get more movement in the contract (ie possibility of profit) for exactly the same fixed costs (spread, commission). As a daytrader these costs are your main enemies, and volatility helps you to minimize them. Volatility takes you closer to the kind of movements that longer term swing traders look for, but within a much shorter time period. In terms of "how to bear a high volatility situation and hold the position" - you need to be able to cut the position down (if it's causing you problems). This means taking some contracts off. Hope that helps. BlueHorseshoe
  18. Hello, Is it actually the Scanner that you're talking about, or the Radar Screen? I loaded your indicator on a chart, where it worked fine, and then in a Radar Screen where it returned only 0 or 1 as you described. In addition to changing the 'maximum number of bars your study will reference' to 100, I also changed the 'load additional data for accumulative calculations' to 100. After this the indicator displayed the correct value in the Radar Screen. The problem you're having is therefore likely to be to do with the way the indicator is formatted within the scanner/radar screen rather than with your code, which is obviously correct. Hopefully just having a good explore around all the different formatting options will work for you? Kind regards, BlueHorseshoe
  19. About £500 into an IG Index spreadbetting account. It took me about 1 month to lose it. Then I topped it up with the same and lost that more slowly. Then I opened a real futures brokerage account with Infinity and started using TradeStation for charting and managed to tread water daytrading. Then a futures account with TS with a single market strategy that took me on a 12 month rollercoaster ride, eventually cashing in the account to use as a deposit on a property (mostly the equity, not the profit, you should understand). And then 12 months of research but no trading, during which time I asked to be considered for moderator status on TL, and felt like complete imposter when I admitted I wasn't actually trading . . . and then finally an IB account trading ETFs from last July, which seem to offer my small account the desired combination of reduced leverage and massive diversification. Opening account size is all relative. Most new traders should, in my opinion, look for something greatly de-leveraged, where they can test their ideas without losing huge sums. BlueHorseshoe
  20. Hello EasyTrader, Excellent to see that there is now someone else who is prepared to respond to EasyLanguage programming queries on TL - for a moment I thought I was the only one left, and that worried me because I'm not very good at it! Look forward to more posts from you . . . Kind regards, BlueHorseshoe
  21. Draw a box around a consolidation, and then trade breakouts from the box is the gist of it. Made a ballerina called Darvas some money a very long time ago . . . BlueHorseshoe
  22. I'm not sure that I buy this argument Yes, I can certainly do things a multi-billion dollar fund cannot . . . but there are a heck of a lot more things they can do that I can't . . . And really, all that you are both are saying is that we can beat these funds by doing something different to them, albeit aligned with the same long term trend, rather than by doing the same as them. Which I would agree with. If your entries and exits aren't the same, or you're using varying amounts of leverage (different position sizing, to all intents and purposes), then you're not trading the same. You're doing something different, and potentially better. If you follow what these institutional participants do in any precise sense, then odds are you'll underperform the index. I do agree with SIYUA's point that those who have good long term performance records aren't really concerned with benchmarking, but rather trade for absolute returns. Anyway, whatever you both do or don't do - best wishes for 2014! Regards, BlueHorseshoe
  23. Hi Thomas, There is a contradiction here: why would I want to 'trade along with institutional money moves' when, as your article points out, most of them fail to beat the index? BlueHorseshoe
  24. Try telling this to anyone here in the UK; the FTSE is at pre-crash levels, property is at an all time high, borrowing money is cheap and getting easier again, retail has picked up . . . But something doesn't quite feel right. There's no 'exhuberance' in the UK economy. Is this as good as it gets nowadays? Are we in clover? BlueHorseshoe
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.