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.

simterann22

Members
  • Content Count

    64
  • Joined

  • Last visited

Everything posted by simterann22

  1. Hi Suri, thanks for your reply. I've tested it and it says only the interval and the text following. It will not say the symboltext from the function output. When I made the function I told it to output a text string. Is that correct? Any ideas?
  2. Dovetree I was thinking about your request regarding down time. You could try this code: if currentsession(0)<>currentsession(0)[1] or date<>date[1] or [HIGHLIGHT GREEN]open<low[1] or open>high[1][/HIGHLIGHT GREEN] then I'm assuming that any gap would mean that the open is outside the range of the previous bar and that means during a down time as well. I'm still a newbie coder and I'm not sure if this would do the trick.
  3. I'm getting stuck on an alert output. Basically I have a RadarScreen with 18 Forex Majors/ Crosses. I have 2 time frames set up, 15min and 60min. When my alert is triggered I have one of a possible 36 symbols and time frames to search through. This is far from a major feat but I would like to know which currency pair and which time frame is being triggered at the time of the alert. I use text to speech so I would like the PC to say "Euro Yen 60 minute just fired off" for a EURJPY pair on a 60 minute chart, or "Aussie Dollar 15 minute just fired off" for a AUDUSD pair on a 15 minute chart. The idea was to write a function that converted the symbol to a text output giving the nicknames of the pairs. This function output, along with the BarInterval reserved word plus some text would make up the above alert. eg. Alert(SymbolText+BarInterval+"minute just fired off"). The syntax I can't get right so this is what I need help with. Here is my code I started with. {*********************SymbolText Function*****************} vars: audjpy(0),audusd(0),cadjpy(0),chfjpy(0),euraud(0),eurcad(0), eurchf(0),eurgbp(0),eurjpy(0),eurusd(0),gbpchf(0),gbpjpy(0), gbpusd(0),nzdjpy(0),nzdusd(0),usdcad(0),usdchf(0),usdjpy(0); begin if symbolroot="audjpy" then SymbolText="Aussie Yen"; if symbolroot="audusd" then SymbolText="Aussie Dollar"; if symbolroot="cadjpy" then SymbolText="Loonie Yen"; if symbolroot="chfjpy" then SymbolText="Swissie Yen"; if symbolroot="euraud" then SymbolText="Euro Aussie"; if symbolroot="eurcad" then SymbolText="Euro Loonie"; if symbolroot="eurchf" then SymbolText="Euro Swissie"; if symbolroot="eurgbp" then SymbolText="Euro Sterling"; if symbolroot="eurjpy" then SymbolText="Euro Yen"; if symbolroot="eurusd" then SymbolText="Euro Dollar"; if symbolroot="gbpchf" then SymbolText="Sterling Swissie"; if symbolroot="gbpjpy" then SymbolText="Sterling Yen"; if symbolroot="gbpusd" then SymbolText="Cable"; if symbolroot="nzdjpy" then SymbolText="Kiwi Yen"; if symbolroot="nzdusd" then SymbolText="Kiwi Dollar"; if symbolroot="usdcad" then SymbolText="Dollar Loonie"; if symbolroot="usdchf" then SymbolText="Dollar Swissie"; if symbolroot="usdjpy" then SymbolText="Dollar Yen"; end; So in my code on my RadarScreen indicator I would have something like this: Alert(SymbolText+BarInterval+"minute just fired off"); But this syntax does not agree with me. Any help would be appreciated. Cheers.
  4. My coding attempts above..... replace the [-1] s with [1]......sorry. I've written it in a 'logical' format not necessarily an EL format. I have asked Admin to change it. Cheers.
  5. I was trying to do something similar like: Gradient[0]=d[0]/x Gradient[1]=d[1]/x where d[0] = close difference between the current bar and the previous bar. where d[1] = close difference between the previous bar and two bars ago. x is time so is always a constant. So if time is a constant then all that matters is to compare d[0] and d[1]. If the MA is going up : MA>MA[1] If d[0]>d[1] then MA is rising faster. If d[0]<d[1] then MA is rising slower. If the MA is going down: MA<MA[-1] If d[0]<d[1] then MA is falling faster. If d[0]>d[1] then MA is falling slower. Now, in order for it to change color based on gradient of the slope then I thought to use GradientColor. You can define the minimum value as zero.The only problem is how do you define the MAXIMUM difference of the MA? Will it be 2 points? Will it be 200 points? It depends on the symbol price, compare Google with EURUSD. So you could write: diff=MA-MA[1] //difference ie. d[0] above If MA > MA[1] then //uptrend MAColor=GradientColor(diff,0,xxxxxxx,Blue, Green); //where green is steep gradient. It will turn back to blue as the MA slows down. If BB_Macd < BB_Macd[1] then //downtrend MAColor=GradientColor(diff,-xxxxxxx,0,Magenta, Red); //where magenta is steep gradient. It will turn back to red as the MA slows down. SetPlotColor(1,MAColor); The problem is how do you define xxxxxxx or the maximum difference?? I thought of using a ratio between d[0] and d[1] and using that but at that point my head was full and decided to put it on the backburner for now. Any comments?
  6. Peter, are you using Firefox or another browser other than Internet Explorer? I use Firefox but I found IE worked for the search. Hope it helps.
  7. Ajax358, I'm glad you've found a good use for it. How are you using the indicator? I'm curious to know since you mentioned scalping the crosses. What sort of timeframe? Would you mind sharing? Cheers.
  8. Again....have to ask the silly questions...... I'm assuming you cut and paste the code as a new indicator, and not installed via the ELD, since you say you verified it. Yeah? If so, did you make a new 'indicator' or did you mistakenly make a new paintbar, showme or function? :crap: Here is a copy of the code in text file just in case you missed any code while copying it: FTPs @Sessiontimes.txt
  9. Hi Tams, yeah......I just cut and shut and learn as I go. :embarassed: If it works it works......but I do like to improve my coding all the time......so appreciate it. Cheers.
  10. Here's something pretty cool IMHO..... Just add: //Squeeze Input SQLength(20), nKeltner(1.5), nBBands(2), AlertLine( 1); under your FastMACD inputs. (Remember to change the semicolon after 'zerocolor' to a comma (,). Then add below your FastMACD code: Vars: SDevSQ(0),ATR(0),LHMult(0),Denom(0),BBS_Ind(0); if ( barnumber=1 ) then Begin If minmove <> 0 then LHMult = pricescale/minmove; end; ATR = AvgTrueRangeGL(SQLength); SDevSQ = StandardDev(RelC, SQLength, 1); Denom = (nKeltner*ATR); If Denom <> 0 then BBS_Ind = (nBBands * SDevSQ) /Denom; If BBS_Ind < Alertline then SetPlotColor(1, Red); then press F3 to compile. This turns the FastMACD dots to red if a BB Squeeze is happening ie. when the BBs are inside the Keltner Channels. So when it turns red look for chop and slowing of volatility. When it exits red along with an increase in the distance between the dots you may be looking at a decent move. You can change the squeeze length, BB and KC settings to suit your taste. Edit: In order for this to work you will need to install the Gapless Squeeze http://www.traderslaboratory.com/forums/f46/gapless-squeeze-6161.html#post68059, because you'll need the AvgTrueRangeGL function. If you don't want to bother then just change AvgTrueRangeGL to AvgTrueRange (although it won't be as accurate for session gaps).
  11. Here is a 'squeeze-like' indicator I converted from some very good code. Trend39 from the TS forums converted the Klinger and Goslin together adding an ATR factor to it. Here are the links to the originals: http://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=26841 http://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=26605 http://www.tradestation.com/Discussions/Topic.aspx?Topic_ID=37624 [LegacyColorValue = true]; {_KlingerVolume Function} {KlingerOsc} value1 = KVO_rd(34, 55); value2 = Summation(value1, 1); if 1 <= 1 then begin _KlingerVol = value1; end else _KlingerVol = value2; {KVO Function} Inputs: FastX(Numeric), SlowX(Numeric); Vars: FXAvg(0), SXAvg(0); FXAvg = XAverage(VForce_rd, FastX); SXAvg = XAverage(VForce_rd, SlowX); {Samll change made to Vforce_rd to make volume smaller)} KVO_rd = (FXAvg - SXAvg); {V-Force Function} Vars: TSum(0), Trend(0), DM(0), CM(0); TSum = High + Low + Close; DM = High - low; IF TSum > TSum[1] Then Trend = 1 Else Trend = -1; IF Trend = Trend[1] Then CM = CM + Range Else CM = Range + Range[1]; IF CM <> 0 Then VForce_rd = Volume * AbsValue(2 * (DM/CM) -1) * Trend * 0.01; {0.01 works great too; original version had * 100. Made smaller to decrease the plotted size of volume} [LegacyColorValue = true]; {Volume Flow Indicator + Klinger Volume Indicator + ATR Summation Trend39 compiled into one indicator Simterann22 made changes below:Zeroline turns red when Klinger is below trigger line and green when above trigger line. Klinger Histogram shows volume increasing or decreasing} Inputs: ATRLength(21), Trigger(13), SmoothATR(1), Smooth(5), UpVolColor(green), UpVolColor2(darkGreen), DnVolColor(red), DnVolColor2(darkRed); value1= summationif(close > open,truerange,ATRlength); value2=summationif(close < open,truerange,ATRlength); value3= value1-value2; {Sum} value4 = average(value3,SmoothATR)*.5; value5= Average((_KlingerVol+ Value4)*1/2,Smooth); plot1(0,"Zero line"); plot98(0,"Zero Line BG");//Aesthetic plot2(value5,"Klinger+ATR"); plot3 (average(value5,Trigger),"Trigger"); //Histogram If Plot2>0 and Plot2>Plot2[1] then setplotcolor(2,UpVolColor); If Plot2<0 and Plot2>Plot2[1] then setplotcolor(2,DnVolColor2); If Plot2<0 and Plot2<PLot2[1] then setplotcolor(2,DnVolColor); If Plot2>0 and Plot2<PLot2[1] then setplotcolor(2,UpVolColor2); //ZeroLine If plot2>plot3 then begin setplotcolor(1,UpVolColor); setplotcolor(98,UpVolColor2);//aesthetic only: must plot thicker and darker color than plot1 end; If plot2<plot3 then begin setplotcolor(1,DnVolColor); setplotcolor(98,DnVolColor2);//aesthetic only: must plot thicker and darker color than plot1 end; @SK_KLINGER GOSLIN ATR.ELD TradeStation Forum - Klinger Oscillator.pdf TradeStation Forum -KLINGER VOLUME.pdf
  12. I've updated the code to : *Show crossing of BB's more accurately and to plot the correct BB lines if you so wish (you will however have to 'uncomment' the plots out to show them though). The BB lines were plotted off the standard MACD instead of the FastMACD in V1, but since I do not use the indicator this way I had not noticed. *Allow the 'non directional plot' to work ie. if you do not want the white and magenta directional dots, they will appear green. Of course the colors are mostly hard-coded in EL for simplicity but you can easily change them if you wish to do so. *Fixed the alert. Please let me know if you know of any more bugs or any new ways to improve this indicator. Cheers. {************************sk_FastMACD_Gapless*********************} {************************Simterann22 2009************************} inputs: price(close), fastlength (12), slowlength (26), signal (9), BBstDv(1), DirColor(True), BBColorUp(White), BBColorDn(Magenta), ZeroColor(DarkCyan); VARS: BB_Macd(0), MyMACD(0), Avg(0), AvgBB(0), SDev(0), Alert_Msg(" "), Upper_Band(0), Lower_Band(0), BBColor(0), Cross_Up(False), Cross_Dn(False); // gapless day transitions - John McCormick May 2008 Vars: RelO(0), // Relative Open RelH(0), // Relative High RelL(0), // Relative low RelC(0), // Relative Close gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps if currentsession(0)<>currentsession(0)[1] or date<>date[1] then begin gap=GapCoef*(O-C[1]); Accum=Accum+gap; end; if BarType<=1 then //Valid only for Tick or Intraday begin RelO = O-Accum; RelC = C-Accum; RelH = H-Accum; RelL = L-Accum; end else begin RelO = O; RelC = C; RelH = H; RelL = L; end; // Gapless - end Var: GL_Price(0); GL_price = RelC; If Price=open then GL_price = RelO; If Price=high then GL_price = RelH; If Price=low then GL_price = RelL; BB_Macd = FMA_smooth(MACD_HMA_FMA(GL_price, FastLength, SlowLength),3)*0.5 ;//added FMA_smooth to smooth 'bumps' MyMACD = MACD( GL_price, FastLength, SlowLength )*1.5 ;//Standard MACD Avg = XAverage( MyMACD, Signal);//Plotted standard MACD signal AvgBB = XAverage( BB_Macd,Signal ) ;//Average for FastMACD, not plotted SDev = StandardDev( BB_Macd, Signal, 1); Upper_Band = ( AvgBB + BBStDv * SDev ); Lower_Band = ( AvgBB - BBStDv * SDev ); if DirColor=True then begin If BB_Macd > BB_Macd[1] then BBColor = BBColorUp else BBColor = BBColorDn; If Cross_Up = False then if BB_Macd > Upper_Band then begin Cross_Up = True; Cross_Dn = False; BBColor = Cyan; Alert( "BB cross up "); end; If Cross_Dn = False then if BB_Macd < Lower_Band then begin Cross_Up = False; Cross_Dn = True; BBColor = Yellow; Alert( "BB cross down "); end; Plot1( BB_Macd, "BBMACD" ,BBColor ); end else begin Plot1( BB_Macd, "BBMACD" ,Green); end; Plot2(Avg, "Signal",Cyan,1); Plot3(MyMACD, "MACD", Green,2); Plot4( 0, "Zero_Line", ZeroColor ); //Plot5(Upper_Band,"Upper Band",Red,1); //Plot6(Lower_Band,"Lower Band",Red,1); @SK_FAST_MACDBB_V2.ELD
  13. Tams, First of all with TS I had to change the 'plots' around so that the dot becomes PLot1. This was because TS would plot the gray lines in front of the dots since it had 'first priority'. I set this up as a standard indicator which is fine, but I can't see some of the price data. In other words, the gray lines cover some of the bar charts. Is there a way to put the indicator 'behind' the data with TS? I'm sure when I have time later I can play around with a showme version. Cheers.
  14. Here is a fast MACD using a Hull Moving Average and a Fractal Moving Average. The FastMACD dots change color when they breach outside their Bollinger Bands (which you can't see). I have taken from other coder's work, so full credit goes to them. I have simply added the faster MAs and incorporated the BBs. This indicator came about just by experimenting. So try an idea out......you never know It seems to pick the highs and lows nicely. I have coded it with a standard MACD so I can see divergences. You are quite welcome to add or remove anything and post it if you think it has merit. The indicator also has a gapless code added which will take into account opening gaps on intraday charts. I use this with Blu-Ray's Paintbars (Similar to the Heikin Ashi), Double Stochastics and The Gapless Squeeze (here): http://www.traderslaboratory.com/forums/f46/gapless-squeeze-6161.html#post68059 Here is the code: {**************FMA Function******************} // generates very smooth and responsive moving average // copyright 2008 John McCormick // feel free to copy and use this code royalty free // as long as you don't remove the above acknowledgement // Inputs: Price(numericseries), Length(numericsimple); Vars: j(0), workinglen(maxlist(1,absvalue(Length))), peak(workinglen/3), tot(0), divisor(0); Array: val[100](0); if workinglen>100 then workinglen=100; // use larger array to handle lengths over 100 tot=0; divisor=0; for j=1 to floor(workinglen+1) begin if j<=peak then val[j]=j/peak else val[j]=(workinglen+1-j)/(workinglen+1-peak); tot=tot+price[j-1]*val[j]; divisor=divisor+val[j]; end; if divisor<>0 then FMA_smooth=tot/divisor; {jtHMA - Hull Moving Average Function} {Author: Atavachron} {May 2005} Inputs: price(NumericSeries), length(NumericSimple); Vars: halvedLength(0), sqrRootLength(0); { Original equation is: --------------------- waverage(2*waverage(close,period/2)-waverage(close,period), SquareRoot(Period) Implementation below is more efficient with lengthy Weighted Moving Averages. In addition, the length needs to be converted to an integer value after it is halved and its square root is obtained in order for this to work with Weighted Moving Averaging } if ((ceiling(length / 2) - (length / 2)) <= 0.5) then halvedLength = ceiling(length / 2) else halvedLength = floor(length / 2); if ((ceiling(SquareRoot(length)) - SquareRoot(length)) <= 0.5) then sqrRootLength = ceiling(SquareRoot(length)) else sqrRootLength = floor(SquareRoot(length)); Value1 = 2 * WAverage(price, halvedLength); Value2 = WAverage(price, length); Value3 = WAverage((Value1 - Value2), sqrRootLength); jtHMA = Value3; {***************FastMACD Function********************** inputs: Price( numericseries ), FastLength( numericsimple ), { this input assumed to be a constant >= 1 } SlowLength( numericsimple ) ; { this input assumed to be a constant >= 1 } MACD_HMA_FMA = jthma( Price, FastLength ) - FMA_smooth( Price, SlowLength ) ; { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** } {******************FastMACD Indicator*************} inputs: price(close), fastlength (12), slowlength (26), signal (9), BBstDv(1), DirColor(True), BBColorUp(White), BBColorDn(Magenta), ZeroColor(DarkCyan); VARS: BB_Macd(0), MyMACD(0), Avg(0), SDev(0), Alert_Msg(" "), Upper_Band(0), Lower_Band(0), BBColor(0), Cross_Up(False), Cross_Dn(False); // gapless day transitions - John McCormick May 2008 Vars: RelO(0), // Relative Open RelH(0), // Relative High RelL(0), // Relative low RelC(0), // Relative Close gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps if currentsession(0)<>currentsession(0)[1] or date<>date[1] then begin gap=GapCoef*(O-C[1]); Accum=Accum+gap; end; if BarType<=1 then //Valid only for Tick or Intraday begin RelO = O-Accum; RelC = C-Accum; RelH = H-Accum; RelL = L-Accum; end else begin RelO = O; RelC = C; RelH = H; RelL = L; end; // Gapless - end Var: GL_Price(0); GL_price = RelC; If Price=open then GL_price = RelO; If Price=high then GL_price = RelH; If Price=low then GL_price = RelL; BB_Macd = FMA_smooth(MACD_HMA_FMA(GL_price, FastLength, SlowLength),3)*0.5 ;//added xaverage to smooth 'bumps' MyMACD = MACD( GL_price, FastLength, SlowLength )*1.5 ; //Avg = FMA_smooth( BB_Macd, Signal); Avg = XAverage( MyMACD,Signal ) ; SDev = StandardDev( BB_Macd, Signal, 1); Upper_Band = ( Avg + BBStDv * SDev ); Lower_Band = ( Avg - BBStDv * SDev ); //******************************************************// // Sub-Graph plot logic. // //******************************************************// if DirColor=True then begin If BB_Macd > BB_Macd[1] then BBColor = BBColorUp else BBColor = BBColorDn; If Cross_Up = False then if BB_Macd > Upper_Band then begin Cross_Up = True; Cross_Dn = False; BBColor = Cyan; If CheckAlert then Alert( "BB cross up " + Alert_Msg ); end; If Cross_Dn = False then if BB_Macd < Lower_Band then begin Cross_Up = False; Cross_Dn = True; BBColor = Yellow; If CheckAlert then Alert( "BB cross down " + Alert_Msg ); end; Plot1( BB_Macd, "BBMACD" ,BBColor ); Plot2(Avg, "Signal",Cyan); Plot4( 0, "Zero_Line", ZeroColor ); Plot3(MyMACD, "MACD", green,2); end else setplotcolor(1,green); @SK_FAST_MACDBB.ELD
  15. Here is the link to Floor Trader Pivots if anyone is interested: http://www.traderslaboratory.com/forums/f46/floor-trader-pivots-session-times-6256.html#post69419
  16. Sorry, I have to ask some silly questions first: Did the ELD install? Did you verify the 'cut and paste version'? Did you get anything on your screen? Did you apply it to 'Use Same Axis as Underlying Data'?
  17. Tams, what is the best way to use this indicator and with what other indicator(s) do you couple it with? :Cheers:
  18. Hi all, I'm posting this Floor Trader Pivots indicator because it's been modified for use with session times rather than a 'new day' crossover. For FTPs to work properly with futures or forex they must be based on the session times. eg. ES 330pm -315pm CT and forex 5pm-5pm ET (although some use other times for forex) not to mention weekend times being different from weekday times as well. I found the standard TS FTP indicator does not use session times, so after a frustrating weeks search I was nearly ready to buy (hit me now!) a commercial FTP indicator. The answer to my problem was from the Tradestation forum: I simply had to use : if currentsession(0)<>currentsession(0)[1] instead of if date<>date[1] . Here is the complete code: {Floor Trader Pivots with session time use} inputs: Plot_5or7( 5), { if 7, adds plots for S3 and R3 to other 5 lines } PlotDailyPivots ( true), PlotWeeklyPivots (true), PlotMonthlyPivots (true), PlotDailyMidPts( true), PlotWeeklyMidPts( true), PlotMonthlyMidPts( true); variables: S1( 0 ), WeekS1( 0 ), MonthS1( 0 ), S2( 0 ), WeekS2( 0 ), MonthS2( 0 ), S3( 0 ), WeekS3( 0 ), MonthS3( 0 ), R1( 0 ), WeekR1( 0 ), MonthR1( 0 ), R2( 0 ), WeekR2( 0 ), MonthR2( 0 ), R3( 0 ), WeekR3( 0 ), MonthR3( 0 ), PP( 0 ), WeekPP( 0 ), MonthPP( 0 ), YestHigh( 0 ), LastWeekHigh( 0 ), LastMonthHigh( 0 ), YestLow( 0 ), LastWeekLow( 0 ), LastMonthLow( 0 ), YestClose( 0 ), LastWeekClose( 0 ), LastMonthClose( 0 ), Counter( 0 ) ; if currentsession(0) <> currentsession(0)[1] then //session times //if Date <> Date[1] then //midnight open/close begin { increment Counter to be sure enough data is processed - see comment below } Counter = Counter + 1 ; YestHigh = HighD( 1 ) ; YestLow = LowD( 1 ) ; YestClose = CloseD( 1 ) ; PP = ( YestHigh + YestLow + YestClose ) / 3 ; R1 = PP * 2 - YestLow ; R2 = PP + YestHigh - YestLow ; R3 = R2 + YestHigh - YestLow ; S1 = PP * 2 - YestHigh ; S2 = PP - YestHigh + YestLow ; S3 = S2 - YestHigh + YestLow ; end ; if DayofWeek( Date ) < DayofWeek( Date[1] ) then begin LastWeekHigh = HighW( 1 ) ; LastWeekLow = LowW( 1 ) ; LastWeekClose = CloseW( 1 ) ; WeekPP = ( LastWeekHigh + LastWeekLow + LastWeekClose ) / 3 ; WeekR1 = WeekPP * 2 - LastWeekLow ; WeekR2 = WeekPP + LastWeekHigh - LastWeekLow ; WeekR3 = WeekR2 + LastWeekHigh - LastWeekLow ; WeekS1 = WeekPP * 2 - LastWeekHigh ; WeekS2 = WeekPP - LastWeekHigh + LastWeekLow ; WeekS3 = WeekS2 - LastWeekHigh + LastWeekLow ; end ; if Month( Date ) <> Month( Date[1] ) then // detected a new month begin LastMonthHigh = HighM( 1 ) ; LastMonthLow = LowM( 1 ) ; LastMonthClose = CloseM( 1 ) ; MonthPP = ( LastMonthHigh + LastMonthLow + LastMonthClose ) / 3 ; MonthR1 = MonthPP * 2 - LastMonthLow ; MonthR2 = MonthPP + LastMonthHigh - LastMonthLow ; MonthR3 = MonthR2 + LastMonthHigh - LastMonthLow ; MonthS1 = MonthPP * 2 - LastMonthHigh ; MonthS2 = MonthPP - LastMonthHigh + LastMonthLow ; MonthS3 = MonthS2 - LastMonthHigh + LastMonthLow ; end ; if Counter >= 2 then { if at least one full day's data has been processed} begin if bartype=0 then //tick chart only begin if PlotDailyPivots = true then begin if Plot_5or7 = 7 then Plot1( R3, "R3" ) ; Plot2( R2, "R2" ) ; Plot3( R1, "R1" ) ; Plot4( PP, "PP" ) ; Plot5( S1, "S1" ) ; Plot6( S2, "S2" ) ; if Plot_5or7 = 7 then Plot7( S3, "S3" ) ; end; if PlotDailyMidPts then begin Plot22((PP+S1)/2,"PPmidS1"); Plot23((S1+S2)/2,"S1midS2"); Plot24((S2+S3)/2,"S2midS3"); Plot25((PP+R1)/2,"PPmidR1"); Plot26((R1+R2)/2,"R1midR2"); Plot27((R2+R3)/2,"R2midR3"); end; end; if bartype<=1 then //tick and intraday chart only begin if PlotWeeklyPivots = true then begin if Plot_5or7 = 7 then Plot8( WeekR3, "WeekR3" ) ; Plot9( WeekR2, "WeekR2" ) ; Plot10( WeekR1, "WeekR1" ) ; Plot11( WeekPP, "WeekPP" ) ; Plot12( WeekS1, "WeekS1" ) ; Plot13( WeekS2, "WeekS2" ) ; if Plot_5or7 = 7 then Plot14( WeekS3, "WeekS3" ) ; end; if PlotWeeklyMidPts then begin Plot28((WeekPP+WeekS1)/2,"WPPmidWS1"); Plot29((WeekS1+WeekS2)/2,"WS1midWS2"); Plot30((WeekS2+WeekS3)/2,"WS2midWS3"); Plot31((WeekPP+WeekR1)/2,"WPPmidWR1"); Plot32((WeekR1+WeekR2)/2,"WR1midWR2"); Plot33((WeekR2+WeekR3)/2,"WR2midWR3"); end; end; if bartype<=2 then //tick, intraday or daily chart only begin if PlotMonthlyPivots = True then begin if Plot_5or7 = 7 then Plot15( MonthR3, "MonthR3" ) ; Plot16( MonthR2, "MonthR2" ) ; Plot17( MonthR1, "MonthR1" ) ; Plot18( MonthPP, "MonthPP" ) ; Plot19( MonthS1, "MonthS1" ) ; Plot20( MonthS2, "MonthS2" ) ; if Plot_5or7 = 7 then Plot21( MonthS3, "MonthS3" ) ; end; if PlotMonthlyMidPts then begin Plot34((MonthPP+MonthS1)/2,"MPPmidMS1"); Plot35((MonthS1+MonthS2)/2,"MS1midMS2"); Plot36((MonthS2+MonthS3)/2,"MS2midMS3"); Plot37((MonthPP+MonthR1)/2,"MPPmidMR1"); Plot38((MonthR1+MonthR2)/2,"MR1midMR2"); Plot39((MonthR2+MonthR3)/2,"MR2midMR3"); end; end; end; Bear in mind I have hard coded the FTPs to appear a certain way based on my chart type. eg. daily pivots will not appear on anything but a tick chart, weekly will not appear on daily chart, simply because it gets too cluttered and I was tired of having to change the inputs tab everytime I changed the timeframe. Since I use multiple time frame charts next to each other I can see them all together. I personally like to see the FTPs as lines, but you can eliminate the 'joining lines' as the FTPs change by using left ticks or dots. Some issues: 1) Tick chart FTPs may be slightly different from correct daily, weekly etc.. This I believe is because of the 'lack of time factor'. I don't know of a solution for this other than keeping an intraday pivot chart next to your tick chart. The Data2 solution (below) does not work with tick charts either. Any ideas? 2) This indicator WILL NOT WORK on a futures day session chart eg. ES.D in its current format above as it does not take into account the highs and the lows of the overnight session. However you could add a hidden Data2 (plot DAILY Globex) and change the code regarding yesterday's H,L and C. YestHigh = HighD( 1, data2) ; YestLow = LowD( 1 , data2) ; YestClose = CloseD( 1, data2) ; 3) Make sure you set the minimum range to say 2 months so that your monthly and weekly FTPs will be correct. Make sure when you have plotted the indicator that you check a reliable Pivot website and crosscheck your data. I find I need to set up a custom session (I call Globex) set with the exact Globex futures times for the FTPs to be accurate. BTW does anyone know how to code to plot differently for different minute or tick timeframes eg. 5min compared to 240min etc.? I find the 'bartype' reserved word a little to inflexible. Enjoy. FLOOR_TRADER_PIVOTS_SESSION_TIMES.ELD
  19. Sure, I'll keep that in mind next time. BTW I do not use the Parabolic SAR indicator but if you have any requests I'll help where I can. I am still a newbie coder so all of these indicators are simply put together with a bit of logic and the good old 'cut and paste' I also like the gapless code and it's flexibility and common sense but I rarely trade gaps since I trade Forex. Here is the PSAR code: inputs: AfStep( 0.02), AfLimit( 0.2 ) ; variables: oParCl( 0 ), oParOp( 0 ), oPosition( 0 ), oTransition( 0 ), Str( "" ), gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps Value1 = PSAR( AfStep, AfLimit, oParCl, oParOp, oPosition, oTransition ) ; if currentsession(0)<> currentsession(0)[1] or date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; If bartype<=1 then Plot1( oParCl + Accum, "ParCl" ) else Plot1( oParCL,"ParCL"); { Alert criteria } if oTransition = 1 then Alert( "Bullish reversal" ) else if oTransition = -1 then Alert( "Bearish reversal" ) ; { Alternate alert criteria to write next reversal level to alert dialog box Str = NumToStr( oParOp, 2 ) ; if oPosition = 1 then Alert( "At next bar, stop and reverse current long position at " + Str ) else if oPosition = -1 then Alert( "At next bar, stop and reverse current short position at " + Str ) ; } { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** } The PSAR function (just a modified Para SAR function): { Parabolic Stop and Reverse multiple-output function; see MULTIPLE-OUTPUT FUNCTIONS note below Gapless Version} inputs: AfStep( numericsimple ), { acceleration factor step, generally set to 0.02 } AfLimit( numericsimple ), { acceleration factor limit, generally set to 0.2 } oParCl( numericref ), { final stop for today, diff from init stop on revrsl days } oParOp( numericref ), { initial stop for tomorrow } oPosition( numericref ), { position at end of day, can be 1 or -1 } oTransition( numericref ) ; { revrsl days return 1 or -1, holding days return 0 } variables: TradeHH( 0 ), TradeLL( 0 ), Af( 0 ) ; // gapless day transitions - John McCormick May 2008 Vars: RelO(0), // Relative Open RelH(0), // Relative High RelL(0), // Relative low RelC(0), // Relative Close gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps if currentsession(0)<> currentsession(0)[1] or date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; if BarType<=1 then //Valid only for Tick or Intraday begin RelO = O-Accum; RelC = C-Accum; RelH = H-Accum; RelL = L-Accum; end else begin RelO = O; RelC = C; RelH = H; RelL = L; end; // Gapless - end if CurrentBar = 1 then begin oParOp = RelH ; oPosition = -1 ; TradeHH = RelH ; TradeLL = RelL ; end ; oTransition = 0 ; if RelH > TradeHH then TradeHH = RelH ; { UPDATE Highest High of current Trade } if RelL < TradeLL then TradeLL = RelL ; { UPDATE Lowest Low of current Trade } if oPosition = 1 then { CHECK FOR INCOMING LONG POSITIONS } begin if RelL <= oParOp then { ie, if OPENING STOP for this bar was breached } begin oPosition = -1 ; oTransition = -1 ; { Rev pos & alert - this is a LONG TO SHORT reversal bar } oParCl = TradeHH ; { Set the CLOSING STOP for this bar } TradeHH = RelH ; { Re-initialize TradeHH with the current HIGH } TradeLL = RelL ; { Re-initialize TradeLL with the current LOW } Af = AfStep ; { Re-initialize the Af } oParOp = oParCl + Af * ( TradeLL - oParCl ) ; { Calculate the OPENING STOP for the next bar } if oParOp < RelH then oParOp = RelH ; { Make sure it is not below the current bar's high } if oParOp < RelH[1] then oParOp = RelH[1] ; { or the previous bar's high } end else { ie, if this is a LONG TO LONG holding bar } begin oParCl = oParOp ; { set CLOSING STOP for current bar = OPENING STOP for current bar } if TradeHH > TradeHH[1] and Af < AfLimit then { calculate Af to use for OPENING STOP for next bar } Af = MinList( Af + AfStep, AfLimit ) ; { maxing out at AfLimit } oParOp = oParCl + Af * ( TradeHH - oParCl ) ; { calculate OPENING STOP for next bar } if oParOp > RelL then oParOp = RelL ; { Make sure it is not above the current bar's low } if oParOp > relL[1] then oParOp = RelL[1] ; { or the previous bar's low } end ; end else { CHECK FOR INCOMING SHORT POSITIONS } begin if relH >= oParOp then { ie, if OPENING STOP for this bar was breached } begin oPosition = 1 ; oTransition = 1 ; { Rev pos & alert - this is a SHORT TO LONG reversal bar } oParCl = TradeLL ; { Set the CLOSING STOP for this bar } TradeHH = RelH ; { Re-initialize TradeHH with the current HIGH } TradeLL = RelL ; { Re-initialize TradeLL with the current LOW } Af = AfStep ; { Re-initialize the Af } oParOp = oParCl + Af * ( TradeHH - oParCl ) ; { Calculate the OPENING STOP for the next bar } if oParOp > RelL then oParOp = RelL; { Make sure it is not above the current bar's low } if oParOp > RelL[1] then oParOp = RelL[1] ; { or the previous bar's low } end else { ie, if this is a SHORT TO SHORT holding bar } begin oParCl = oParOp ; { set CLOSING STOP for current bar = OPENING STOP for current bar } if TradeLL < TradeLL[1] and Af < AfLimit then { calculate Af to use for OPENING STOP for next bar } Af = MinList( Af + AfStep, AfLimit ) ; { maxing out at AfLimit } oParOp = oParCl + Af * ( TradeLL - oParCl ) ; { calculate OPENING STOP for next bar } if oParOp < RelH then oParOp = RelH ; { Make sure it is not below the current bar's high } if oParOp < RelH[1] then oParOp = RelH[1] ; { or the previous bar's high } end ; end ; PSAR = 1 ; { function return always 1, not used; only outputs used } { MULTIPLE-OUTPUT FUNCTIONS A multiple-output function has two types of parameters or "inputs" - input parameters and input/output parameters. The values of the input parameters are passed into the multiple-output function, but not modified by the function. The values of the input/ output parameters are passed into the multiple-output function, modified by it, and the modified values are then inherited by - or output to - the calling routine. The input/output parameters are often used for output purposes only, i.e., the incoming values are ignored. The outputs are in addition to the function return. In multiple-output functions, the function return is generally used to return an error code, though sometimes the return may simply be a dummy value. The input/output parameters are declared with a "ref" suffix (such as "numericref") in the multiple-output function's declaration statements. For further clarity, the names of the input/output parameters are generally prefixed with an "o" in the function as well as in all the routines that call the function. The built-in single-return WRAPPER FUNCTIONS that call the multiple-output functions are specialized calling routines designed to offer simplified, alternate pathways to the functionality of the underlying multiple-output functions. In the wrapper functions, the input/output parameters are declared as local variables and generally initialized to zero. They are passed through to the multiple-output function without further modification. After the call, the wrapper function picks out the single output of interest and assigns it as the return of the wrapper function. } { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** }
  20. Just thought you might like this image. It looks promising.....
  21. I'm assuming you mean at the end of futures sessions, weekend etc.? Paste if currentsession(0)<> currentsession(0)[1] or directly in front of date<>date[1]. So in otherwords this part of your code should look like this if currentsession(0)<> currentsession(0)[1] or date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; You must do this for BOTH the indicator AND the function. I've tested it. It should be what you are after. BTW I use the 'currentsession' function to get my pivot point indicator to change values at the session times for Globex futures and Forex, not midnight. Works a treat.
  22. Check the above ELD. I just uploaded a new one in the original's place....I think it worked. I had to modify the code to work properly on daily and above. If it plots different to the standard Parabolic SAR on an intraday/tick chart and exactly the same on a daily and above then it's all good. Otherwise let me know.
  23. Okay....here it goes. I've never used Parabolic SAR so I don't know if this is what you want. I don't know if it turned out right, so let me know. Well, anyway to make any indicator gapless first have a look at the EL for the indicator itself. If any form of 'price' appears in it say O,H,L,C then you can simply paste the gap code in. If it does not, you have to paste the gap code in the FUNCTION that the indicator uses (save and modify a new one of course . Now MACD was easy for this, but because the Parabolic SAR needs both a modified gapless function AND have 'accum' added to it (because it is plotted on price action....see previous posts) this was a problem. I simply got around this by adding gap(0), GapCoef(1.0), Accum(0); if date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; into the indicator code since 'accum' is an independent little program in itself. Just make sure at the 'plot' line to add 'accum' to the value being plotted. (see ELD). Compare the ELDs and the standard ones and you'll figure it all out. GAPLESS PARABOLIC SAR.ELD
  24. Hi all, I am VERY new to Forex. I have been trading futures but like to play Forex on my sim account at present....and I love it if only I can break this problem. Anyway....I've been setting up bracket trades around congestion and pivot points to capture breakouts. I found I was getting my stops hit prematurely so I increased my buffer by making my stops further out. Still no luck. So what 'they' do is get me in the trade, charge me at an inflated market price then it goes against me! ARGGGGH! You will see in the attachments on a GBPCHF trade that my stop was set at 1.75660 but the price never exceeded 1.75610. Huh? Is this because of the spread (which I'm still not fully aware of or is it the way I'm setting up my trades? Thanks a lot.
  25. That's a bit strange.... here is another attachment.... and the code just in case.... inputs: Price(close),FastLength( 12 ), SlowLength( 26 ), MACDLength( 9 ), ZeroLine(False), Histogram(true); variables: MyMACD( 0 ), MACDAvg( 0 ), MACDDiff( 0 ) ; // gapless day transitions - John McCormick May 2008 Vars: RelO(0), // Relative Open RelH(0), // Relative High RelL(0), // Relative low RelC(0), // Relative Close gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps if date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; if BarType<=1 then //Valid only for Tick or Intraday begin RelO = O-Accum; RelC = C-Accum; RelH = H-Accum; RelL = L-Accum; end else begin RelO = O; RelC = C; RelH = H; RelL = L; end; // Gapless - end Var: GL_Price(0); GL_price = RelC; If Price=open then GL_price = RelO; If Price=high then GL_price = RelH; If Price=low then GL_price = RelL; MyMACD = MACD( GL_price, FastLength, SlowLength ) ; MACDAvg = XAverage( MyMACD, MACDLength ) ; MACDDiff = MyMACD - MACDAvg ; Plot1( MyMACD, "MACD" ) ; Plot2( MACDAvg, "MACDAvg" ) ; if Histogram=True then Plot3( MACDDiff, "MACDDiff" ) ; if ZeroLine=True then Plot4( 0, "ZeroLine" ) ; { Alert criteria } if MACDDiff crosses over 0 then Alert( "Bullish alert" ) else if MACDDiff crosses under 0 then Alert( "Bearish alert" ) ; { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** } inputs: Price( Close ), Length( 8), Displace( 0 ) ; variables: AvgExp( 0 ); // gapless day transitions - John McCormick May 2008 Vars: RelO(0), // Relative Open RelH(0), // Relative High RelL(0), // Relative low RelC(0), // Relative Close gap(0), // the opening gap (modified by the gap coefficient) GapCoef(1.0), // Gap Coefficient Accum(0); // The sum of all the daily gaps if date<>date[1] then begin gap = GapCoef*(O-C[1]); Accum = Accum+gap; end; if BarType<=1 then //Valid only for Tick or Intraday begin RelO = O-Accum; RelC = C-Accum; RelH = H-Accum; RelL = L-Accum; end else begin RelO = O; RelC = C; RelH = H; RelL = L; end; // Gapless - end Var: GL_Price(0); GL_price = RelC; If Price=open then GL_price = RelO; If Price=high then GL_price = RelH; If Price=low then GL_price = RelL; AvgExp = XAverage( GL_Price, Length ) ; if Displace >= 0 or CurrentBar > AbsValue( Displace ) then begin Plot1[Displace]( AvgExp + Accum, "AvgExp" ) ; { Alert criteria } if Displace <= 0 then begin if Price > AvgExp and AvgExp > AvgExp[1] and AvgExp[1] <= AvgExp[2] then Alert( "Indicator turning up" ) else if Price < AvgExp and AvgExp < AvgExp[1] and AvgExp[1] >= AvgExp[2] then Alert( "Indicator turning down" ) ; end ; end ; { ** Copyright (c) 2001 - 2009 TradeStation Technologies, Inc. All rights reserved. ** ** TradeStation reserves the right to modify or overwrite this analysis technique with each release. ** } MACD AND EMA GL.ELD
×
×
  • Create New...

Important Information

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