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.

clbradley

Members
  • Content Count

    48
  • Joined

  • Last visited

Everything posted by clbradley

  1. This looks like a good thread here on the subject, with Tradestation ELD and code: http://www.traderslaboratory.com/forums/f46/stochastic-divergence-trendline-7244.html
  2. Looks great metalhead. What's the code for that IFT applied to slow stochastics indicator? Would like to see a code for Tradestation if possible. Thanks again.
  3. How can I put a simple moving average on a spread differential indicator on the same plot underneath price, so the SMA isn't the SMA of the price, but of the spread differential indicator? The SpreadDif and SMA have to be in the same code too, don't they? This is the code for TS's Spread Differential: inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ; Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ; and for the Mov Avg 1 line: inputs: Price( Close ), Length( 9 ), Displace( 0 ) ; variables: Avg( 0 ) ; Avg = AverageFC( Price, Length ) ; if Displace >= 0 or CurrentBar > AbsValue( Displace ) then begin Plot1[Displace]( Avg, "Avg" ) ; end; Just not sure how to paste these together to put them in the same code. Thanks for any help.
  4. How can I put a simple moving average on a spread differential indicator on the same plot underneath price, so the SMA isn't the SMA of the price, but of the spread differential indicator? The SpreadDif and SMA have to be in the same code too, don't they? This is the code for TS's Spread Differential: inputs: DataSeries1( Close of data1 ), DataSeries2( Close of data2 ) ; Plot1( DataSeries1 - DataSeries2, "SprdDiff" ) ; and for the Mov Avg 1 line: inputs: Price( Close ), Length( 9 ), Displace( 0 ) ; variables: Avg( 0 ) ; Avg = AverageFC( Price, Length ) ; if Displace >= 0 or CurrentBar > AbsValue( Displace ) then begin Plot1[Displace]( Avg, "Avg" ) ; end; Just not sure how to paste these together to put them in the same code. Thanks for any help.
  5. Thanks Blowfish. I've seen similar setups before in other strategies using Condition1, Condition2, possibly 3 etc. for a buy or sell/sellshort stating if condition 1 is met first, then condition 2, then 3, then buy next bar at market. But you're just stating it a different way. I'll try it this weekend and let you know if it works. Thanks again for your help. Curtis
  6. Thanks so much simterann22. That looks great.
  7. Great indicators simterann22. Is there any way to code a gapless RSI inside of gapless Bollinger Bands so they're in the same code and both plot on the right axis? I can scale them in the same panel on my charts, but they're skewed and aren't correctly plotting because I have to plot 1 or the other as no axis if they're together. If I put them together and try to plot them both on the right axis, it just shows a line across the page. Guess they need to be put in the same code originally to plot together accurately. Thanks again for your terrific indicators and help. Curtis
  8. Have a Stochastic Crossover Strategy Code for Tradestation that I need help with please. I need to add conditions that the stochastic slow k went to either less than 10 or just less than oversold before crossing back above the oversold line of 20 before buying, and also the opposite, that it got to 90 before crossing back under the overbought level of 80 before selling short. Guess it needs 4 conditions, if 1, then 2 are met, then buy, and if 3 then 4 are met, sell short. Here is the Stochastic Crossover Strategy code so far: inputs: PriceH( High ), PriceL( Low ), PriceC( Close ), StochLength( 14 ), SmoothingLength1( 3 ), SmoothingLength2( 3 ), SmoothingType( 1 ). Oversold( 20 ), Overbought( 80 ) ; variables: FastK( 0 ). FastD( 0 ), SlowK( 0 ), SlowD( 0 ) ; Value1 = Stochastic( PriceH, PriceL, PriceC, StochLength, SmoothingLength1, SmoothingLength2, SmoothingType, FastK, FastD, SlowK, SlowD ) ; If SlowK crosses over SlowD Then buy 1 share next bar at market; If SlowK crosses under SlowD Then sell short 1 share next bar at market; Thanks for any help. Curtis
  9. Thanks so much for your help. I'll have to look at it more one vs. the other this weekend, but looks good so far. Thanks again
  10. Saw this thread about gapless indicators at TS, really like the additions and thank you simterann22. What would be the corrrect way to code a gapless Parabolic SAR indicator? I've been trying to snug the Parabolic SAR recently so it doesn't under or overshoot as much, stays right next to the price and reverses with it, without too much luck. It helps a little to change the 2nd number to .01 from .02, but still needs additional tweaking. Thanks for any help with that if possible and the gapless SAR, and thanks again for adding the extra gapless indicators.
  11. Thank Ken. I do use it on longer timeframes, and run the variable optimizer at TS on different timeframes for various stocks and ETFs, which shows the top 200 combination results. However, I wasn't having any trouble verifying the JMA/DWMA Crossover Strategy code, but am looking for a JMA/JMA Crossover Strategy code that verifies. Mark Jurik says this is the code for JMA/JMA crossovers: Input: series(close), JMA_len1(7), JMA_phase1(50), JMA_len2(14), JMA_phase2(-50), vars: float JMA1(0), float JMA2(0); JMA1 = JRC.JMA.2k ( series, JMA_len1, JMA_phase1); JMA2 = JRC.JMA.2k ( series, JMA_len2, JMA_phase2); But when I try to verify it in a strategy code similar to the JMA/DWMA, it asks for a ( after vars where the : is, and also says that JMA1 and JMA2 are not words recognized by Easy Language, so it won't verify, Does anyone know the proper code for TS 8 with a JMA/JMA crossover strategy? Thanks for any help with this. Curtis
  12. This is the JMA(Jurik)/DWMA Crossover Strategy Code for Tradestation, as written in the April Technical Analysis of Stocks and Commodities magazine: Input: series(close), JMA_len(7), { range: any value > 0 } JMA_phase(50), { range -100 ... +100 } DWMA_len(10); { range: any integer > 1 } vars: float JMA(0), float midDWMA(series), float DWMA(0); JMA = JRC.JMA.2k ( series, JMA_len, JMA_phase); midDWMA = waverage ( series, DWMA_len) ; DWMA = waverage ( midDWMA, DWMA_len) ; if time > 935 AND time < 1545 then begin if JMA crosses over DWMA then buy next bar at market; if JMA crosses under DWMA then sell short next bar at market; end else begin if marketposition = 1 then sell this bar at close; if marketposition = -1 then buytocover this bar at close; end; Juat wondering if anyone is familiar with Jurik moving averages, can you help so it can be coded for a JMA/JMA, and a JMA/EMA Crossover strategy code for Tradestation? Think you may not need the series code, but instead use fast length and slow length, or MA1 and MA2, or value1 and value2. Also think that each JMA needs to have it's own separate JMA_len(#) and JMA_phase(#). Thanks for any help. Curtis
  13. Checked out your link, and it looks like I could exit before the end of each day, and still use the "SetExitOnClose", which will work with Custom Sessions, as described in the TS thread link above. Thanks again, that may work.
  14. I have been having the best results and not that many trades or commissions/slippage when I test the 20-60 min. or greater timeframes. So instead of "1 min chart only", could I instead state "30 min chart only", when run on a 30 min. timeframe, or are you saying that code is good only for 1 min. charts? Thanks for your help, thrunner.
  15. Hey. I have a code which works fairly well in backtesting, but there are bugs in most end of day exit strategy codes at Tradestation, and have noticed recently that SetExitOnClose just works in backtesting. What do I need to do to make sure I'm out by the end of the day or just before? Here's what I have so far: Inputs: FastLength(10), SlowLength(20), StartTime(0930),EndTime(1600); Vars: FastAvg(0),SlowAvg(0); FastAvg = xaverage(Close,FastLength); SlowAvg = xaverage(Close,SlowLength); If Time > StartTime and Time < EndTime then begin If FastAvg crosses above SlowAvg then buy 100 shares next bar at market; If FastAvg crosses below SlowAvg then sellshort 100 shares next bar at market; end; SetProfitTarget(1000); SetStopLoss( 100); SetExitOnClose; Except that now I'll leave the last line out since it only works for backtesting, not in real time. Wondering if I need to put the times at the top (EST?), the time zone I'm in, or New York Time (NYT?), and if it should be changed to 1558 or 1559 end time EST or NYT to be sure and be out before 4 PM (1600 EST), and if it should be stated to sell if long or cover if short at 1558 or 1559 EST near the end of the code. Have seen that there are lots of bugs in most exit end of day codes at TS and they don't stop the trade at the end of the day, and not sure what really works. Thanks for any help and hope you're having a great weekend. Curtis
  16. I tried adding these 2 lines to Blu-ray's last code above: If FastAvg is above SlowAvg at open then buy 100 shares next bar at market; If FastAvg is below SlowAvg at open then sellshort 100 shares next bar at market; and thought they would work above the crossover rules, but when I tried to verify, it said "arithmetic cannot be converted to true/false". Isn't there a way to mesh these rules so that on days after the moving averages have crossed, the strategy can still get in at or near the open to obtain gains on those days when the fast MA remains above or below the slow MA all day or week, and still change upon a cross and exit end of day? Thanks for any help.
  17. Thanks thrunner, for posting the ELD. Now I have to run off to work, and work all weekend, go to school and study a lot of the rest of the time not working, and want to have time for my family as much as possible as well. It is possible that Tams response seemed rude and sarcastic to me, could have just not answered if he didn't know, but I apologize for also being rude back. Sorry Tams, I shouldn't have replied so abruptly, I do appreciate the free indicators, just didn't expect your response and was incorrectly rude in return. Curtis
  18. And you have a great weekend. Let us know if you can actually help with the code for Tradestation. Thanks again.
  19. Sorry Tams, I work and go to school full time, and have a family. If you don't have an answer besides a sarcastic one, maybe someone who knows EL and has the time to help not only me, but lots of other people who use TS and have trouble coding in the wrongly named Easy Language, possibly 50-100 members of Traders Laboratory who would be very interested and thankful that someone could post the code for Tradestation. Thanks again for the free sarcasm and not trying to help.
  20. Can you use a SetProfitTarget(33%); SetStopLoss(8%); using a % instead of a number, and is that how you code it, and how do you code an ATR trailing stop I've seen several authors refer to using to implement a stop loss? Thanks for any help.
  21. Can you code this in Easy Language or an ELD for Tradestation? Thanks.
  22. It looks like with a few other indicators, I mainly use CCI and MACD this way, you can use the divergences, like on 12/15, 12/18, 12/29, 1/6 and 1/20 to catch the big moves and very near if not at tops and bottoms. But of course you would use several other indicators with it, the above mentioned CCI & MACD (both sped up quite a bit), slow stochastics (I use a fast and slow one), RSI, and I draw trendlines on the indicators as well as the price to see when they change and/or show divergence.
  23. Sorry, Multicharts is very different from TS. Things and words that worked on a previous platform at TS won't work on a newer one, and have found that it won't recognnize several words frequently in older codes, and this one is from 1997. I did delete everything, and someone at TS told me to change the function from numeric while starting a new one, to boolean (true/false), and that function verified, and so did the indicator, and tried to use it on a chart, nothing showed up, but received a pop up TS events log that stated "tried to reference future data". May just have to do without this indicator, it just doesn't seem compatible for the latest platform of TS with this code. Thanks for your help. Curtis
  24. Thanks for trying to help Tams and sevensa, but uploaded the function and indicator from your ELS, tried to use it, and get a TS box that says "study not verified". So I opened the indicator and tried to verify, and it said "Error found in function", and blacked over the word Triangle. So they must have changed what Easy Language (that's a laugh) is recognized between your platform and the more recent ones. Thanks again. Curtis
×
×
  • Create New...

Important Information

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