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.

lonew0lf

Members
  • Content Count

    52
  • Joined

  • Last visited

Everything posted by lonew0lf

  1. Done, not sure if the tagging worked.
  2. Should I repost to make it easier to follow or leave it as is?
  3. Man you work fast. Here's what I threw together: //---------------------------------------------------- inputs: //---------------------------------------------------- RSILength(9), StochLength(18), KLength(6), DLength(3), LeftStrength(3), RightStrength(3), Line.Color.Top(magenta), Line.Color.Bot(magenta), Line.Size(2), Plot.stochrsi(1); //---------------------------------------------------- variables: //---------------------------------------------------- DToscK(0), DToscD(0), var0(0), var1(0), var2(0), oPivotPrice1(0), oPivotBar1(0), oPivotPrice2(0), oPivotBar2(0), oPivotPrice11(0), oPivotBar11(0), oPivotPrice12(0), oPivotBar12(0); value1 = FastKCustomEasy(RSI(C, RSILength),StochLength); DToscK = average(value1,KLength); DToscD = average(DToscK,DLength); var0 = StochRSI( Close, RSILength, StochLength, KLength, DLength ); Condition1 = Pivot( var0, RSILength, LeftStrength, RightStrength, 1, -1, oPivotPrice1, oPivotBar1 ) <> -1 AND ( oPivotBar1 - RightStrength ) = 0 ; Condition11 = Pivot( var0, RSILength, LeftStrength, RightStrength, 1, 1, oPivotPrice11, oPivotBar11 ) <> -1 AND ( oPivotBar11 - RightStrength ) = 0 ; Condition2 = Pivot( var0, RSILength, LeftStrength, RightStrength, 2, -1, oPivotPrice2, oPivotBar2 ) <> -1; Condition12 = Pivot( var0, RSILength, LeftStrength, RightStrength, 2, 1, oPivotPrice12, oPivotBar12 ) <> -1; If Condition1 and Condition2 // added condition2 = referecne future data AND L[oPivotBar2] >= L[oPivotBar1] AND var0[oPivotBar2] < var0[oPivotBar1] then Begin Value2 = TL_New(D[oPivotBar2], T[oPivotBar2], L[oPivotBar2], D[oPivotBar1], T[oPivotBar1], L[oPivotBar1]); TL_SetColor( Value2, Line.Color.Bot ); TL_SetSize( Value2, Line.Size ); End; If Condition11 and Condition12 // added condition12 referecne future data AND H[oPivotBar12] <= H[oPivotBar11] AND var0[oPivotBar12] > var0[oPivotBar11] then Begin Value12 = TL_New(D[oPivotBar12], T[oPivotBar12], H[oPivotBar12], D[oPivotBar11], T[oPivotBar11], H[oPivotBar11]); TL_SetColor( Value12, Line.Color.Top ); TL_SetSize( Value12, Line.Size ); End; if Plot.stochrsi <> 0 then begin Plot1( var0 ); end;
  4. Is it possible to apply the same principle of divergence to a StochRSI indicator (divergence drawn on both the price and the indicator)? I tried playing with it on my end but getting a ton of errors. I'm not sure if the errors are due to the 2 lines in the stochrsi versus the single line in the MACD. Below is the code that i'm using for the stochrsi: input: RSILength(9), StochLength(18), KLength(6), DLength(3), oversold(20), overbought(80), overscolor(white), overbcolor(white); Vars: DToscK(0), DToscD(0); value1 = FastKCustomEasy(RSI(C, RSILength),StochLength); DToscK = average(value1,KLength); DToscD = average(DToscK,DLength); plot1(DToscK,"%K" ); plot2(DToscD,"%D" ); plot3( overbought, "OverBot" ) ; plot4( oversold, "OverSld" ) ; condition1 = value1 crosses over oversold ; if condition1 then Alert( "Indicator exiting oversold zone" ) else begin condition1 = value1 crosses under overbought ; if condition1 then Alert( "Indicator exiting overbought zone" ) ; end;
  5. Following up on the last post, does anyone have a PBF_OSOB like indicator. I find the the highlights in the overbought/sold quite areas useful. I attached a screen shot for additional clarification.
  6. Tams - it might be easier to show with a couple charts. The arrows are pointing to what i'd like to accomplish off the zigzag swings.
  7. I found this useful zigzag indicator off elittrader.com and wanted to know how I would go about adding Fibonacci ratios to each high/low swing. Thoughts and comments welcome. // ZigZag JJs // // // pls post your comments and enhancements here: // // inputs: ATRPeriod(9), //Number of ATR Periods ATRMulti(2.0), // ATR Multiplier StrengthSensitivity(2), //Pivot Strength ShowZigZagLines(True), ZigZagLineColorUp(black), ZigZagLineColorDN(black), ZigZagLineWidth(.1), ZigZagLineStyle(tool_solid), ZigZagTextColor(black), VertOffset1(1), VertOffset2(2), // Second String on Swing Hi/Lows DecimalPlaces(2); vars: NewSwingPrice(0), LastSwingPrice(0), SwingPrice(High), SwingDate(Date), SwingTime(time_s), TLDir(0), { TLDir = -1 implies prev TL dn, +1 implies prev TL up } SaveSwing(false), AddTL(false), UpdateTL(false), TLRef(0), TLSwing(0), Diff(0), ArrayMax (17), ATRPoints(0), BarDiff(0), TimeDiff(0), ZigZagCount(0), x(0); Arrays: TrendLine[17] (0), DayValue[17] (0), ZigZag[1000,3](0); if CurrentBar = 1 then begin for x=0 to ArrayMax { Draw Fib Lines } begin if x <= ArrayMax then begin TrendLine[x] = TL_New_s (Date[1], time_s[1], Low, Date, time_s, Low); TL_SetExtLeft (TrendLine[x], false); TL_SetExtRight (TrendLine[x], True); end; // if end; // for end; //if currentbar { Candidate swings are just-confirmed, 3-bar (Str=1), SwingHi's and SwingLo's } NewSwingPrice = SwingHigh( 1, High, StrengthSensitivity, StrengthSensitivity+1); ATRPoints = ATRMulti*AvgTrueRange(ATRPeriod) ; if NewSwingPrice <> -1 then begin if (TLDir <= 0 and NewSwingPrice >= SwingPrice + ATRPoints) then { prepare to add new up TL } begin SaveSwing = true; AddTL = true; TLDir = 1; end else if TLDir = 1 and NewSwingPrice >= SwingPrice then { prepare to update prev up TL } begin SaveSwing = true; UpdateTL = true; end; end else begin { NewSwingPrice = SwingLow( 1, Low, 1, 2 ); } NewSwingPrice = SwingLow( 1, Low, StrengthSensitivity, StrengthSensitivity+1); if NewSwingPrice <> -1 then begin { prepare to add new dn TL } if TLDir >= 0 and NewSwingPrice <= SwingPrice - ATRPoints then begin SaveSwing = true; AddTL = true; TLDir = -1; end else if TLDir = -1 and NewSwingPrice <= SwingPrice then { prepare to update prev dn TL } begin SaveSwing = true; UpdateTL = true ; end; end; end; if SaveSwing then { save new swing and reset SaveSwing } begin SwingPrice = NewSwingPrice ; SwingDate = Date[strengthSensitivity]; SwingTime = time_s[strengthSensitivity]; // SaveSwing = false ; end ; { add new TL and reset AddTL } if AddTL then begin if ShowZigZagLines then begin TLRef = TL_New_s(SwingDate, SwingTime, SwingPrice, SwingDate[1], SwingTime[1],SwingPrice[1]); TL_SetExtLeft( TLRef, false); TL_SetExtRight( TLRef, false); TL_SetSize( TLRef, ZigZagLineWidth); if TLDir = -1 then TL_SetColor( TLRef, ZigZagLineColorDN) else TL_SetColor( TLRef, ZigZagLineColorUp); LastSwingPrice = SwingPrice[1]; end; if (TLDir[1] <> TLDir[2]) then BarDiff = 0 else BarDiff = BarDiff +1; ZigZagCount = ZigZagCount + 1; ZigZag[ZigZagCount,1] = SwingPrice; // Current Swing Price ZigZag[ZigZagCount,2] = BarNumber; // BarNum ZigZag[ZigZagCount,3] = TimetoMinutes(time_s); // Time Var BarDiff = ZigZag[ZigZagCount,2] - ZigZag[ZigZagCount-1,2]; if TLDir = -1 then Diff = LastSwingPrice - SwingPrice else Diff = SwingPrice - LastSwingPrice; TimeDiff = Zigzag[ZigZagcount,3] - Zigzag[ZigZagcount-1,3]; AddTL = false; end else if UpdateTL then { update prev TL and reset UpdateTL } begin if ShowZigZagLines then TL_SetEnd_s( TLRef, SwingDate, SwingTime, SwingPrice); if (TLDir[1] <> TLDir[2]) then BarDiff = 0 else BarDiff = BarDiff +1; ZigZag[ZigZagCount,1] = SwingPrice; // Current Swing Price ZigZag[ZigZagCount,2] = BarNumber[1]; // BarNum ZigZag[ZigZagCount,3] = TimetoMinutes(time_s); // Time Var BarDiff = ZigZag[ZigZagCount,2] - ZigZag[ZigZagCount-1,2]; if TLDir = -1 then Diff = LastSwingPrice - SwingPrice else Diff = SwingPrice - LastSwingPrice; TimeDiff = Zigzag[ZigZagcount,3] - Zigzag[ZigZagcount-1,3]; UpdateTL = false; end; if SaveSwing then begin if TLDir = -1 then begin DayValue[0] = Swingprice; DayValue[1] = LastSwingprice; end else begin DayValue[1] = Swingprice; DayValue[0] = LastSwingprice; end; Diff = DayValue[0] - DayValue[1]; for x=0 to ArrayMax begin if TrendLine[x] > 0 then begin { SetEnd before SetBegin } TL_SetEnd_s (TrendLine[x], Date, time_s, DayValue[x]); TL_SetBegin_s (TrendLine[x], Date, time_s, DayValue[x]); end; // if TrendLine end; // for loop SaveSwing = False; end; // if SaveSwing
  8. Thanks, I'll take a look once more and see if that does it.
  9. I've got a few tradestation indicators that i've been trying to get working in MC. The indicators compile without issue, however when I try and load them into a chart I get: Message: Error in study "PSS_S_PR": :{EXCEPTION} Floating Point Exception Error. Any ideas? Input: LeftStrength(10), RightStrength(2), CheckPivotValue(true); Vars: nColor(0), nDir(0), nShift(0), nPrc(0), nBar(0), iIdx(0), txtID(Symbol + "_PRS"), ret1(0), ret2(0); Array: float arrVal1[100](0); DefineDLLFunc: "PSS_PR.DLL", int , "PSS_ZZ_AddBar",INT,LPSTR,LONG,LONG,INT,int,LPLONG,LPLONG,LPLONG,LPLONG,INT; DefineDLLFunc: "PSS_PR.DLL", int , "PSS_ZZ_CalcPiv", INT,LPSTR,LONG,INT,INT,LPFLOAT; nBar = BarNumber; if CheckPivotValue = false then nBar = -BarNumber; ret1 = PSS_ZZ_AddBar(CustomerID,txtID,Date,Time,nBar,PriceScale,&Open,&High,&Low,&Close,Volume); ret2 = PSS_ZZ_CalcPiv(CustomerID,txtID,BarNumber,LeftStrength,RightStrength,&arrVal1[0]); if ret2 <> 0 then begin //====== DRAW NEW PIVOT ===================================== nShift = arrVal1[0]; nDir = ret2; nPrc = arrVal1[1]; if nDir > 0 AND nShift < MaxBarsBack then // avoid chart/DLL reload when AutoDetect reloads because of shift Plot3[nShift](nPrc,"PivotHigh"); if nDir < 0 AND nShift < MaxBarsBack then Plot4[nShift](nPrc,"PivotLow"); //====== CHECK IF WE CONSOLIDATED OLD PIVOTS AWAY =========== if AbsValue(nDir) > 1 then begin nShift = arrVal1[4]; nDir = ret2; nPrc = arrVal1[5]; if nDir > 0 AND nPrc > 0 AND nShift < MaxBarsBack then Plot1[nShift](nPrc,"PivotHighOld"); if nDir < 0 AND nPrc > 0 AND nShift < MaxBarsBack then Plot2[nShift](nPrc,"PivotLowOld"); end; end;
  10. lonew0lf

    StochRSI

    Awesome, thanks for the follow-up code.
  11. lonew0lf

    StochRSI

    Statsign: Is your code smoothing the indicator to get rid of noise?
  12. lonew0lf

    StochRSI

    Here's the code that I was able to find: input: RSILength(9), StochLength(18), KLength(6), DLength(3), oversold(20), overbought(80), overscolor(white), overbcolor(white); Vars: DToscK(0), DToscD(0); value1 = FastKCustomEasy(RSI(C, RSILength),StochLength); DToscK = average(value1,KLength); DToscD = average(DToscK,DLength); plot1(DToscK,"%K" ); plot2(DToscD,"%D" ); plot3( overbought, "OverBot" ) ; plot4( oversold, "OverSld" ) ; condition1 = value1 crosses over OverSold ; if condition1 then Alert( "Indicator exiting oversold zone" ) else begin condition1 = value1 crosses under OverBought ; if condition1 then Alert( "Indicator exiting overbought zone" ) ; end;
  13. lonew0lf

    StochRSI

    Does anyone have a working StochRSI indicator for MultiCharts or a working code? I've been looking with little success, thanks.
  14. Suppose someone doesn't like to be challenged. You know there's nothing wrong with saying you can't do something, its another when you can't do it and you try and dismiss it. Tams - you're my hero.
  15. Tams - not sure the purpose of your responses... is it to maintain an ongoing banter between you and I? If you're not interested in working on it, that's fine. There isn't more to describe other than looking at the metatrader script the initial charts and beginning the conversation there. If I wanted snark i'd go to elite trader.
  16. Tams - I've got the pasevento indicator, the issue is being able to build off the indicator so it marks out distinct patters such as: ab=cd gartley butterflies etc. The script i posted has the pasevento indicator as a crucial component.
  17. Its the same patterns from harmonic trader, also similar to pesavento patterns. Unfortunately Ensign charts are the only ones with it, nothing for easylanguage or powerlanguage.
  18. Charts just added to provide visuals.
  19. So the folks who use metatrader have had access to a host of indicators, one in particular used for trading harmonics is called ZUP. The persons who created ZUP wrote it in their native language, Russian and i don't believe there ever been a translation I spent the weekend converting it to English as best as I could with the hope that maybe this community could help turn the code into something similar for Multicharts and tradestation users. ZUP83 english.txt
  20. Sep34, I was able to add the text for the remainder of the candlestick indicators but now curious how I would go about painting the bar a different colour so its easier to view. Below is the code you and sevensa helped with: Input: My_TEXT ("Doji"); Input: Txt_below_bar (15); Input: Long_Clr (white); Input: Horizdown (3); Input: Vertdown (2); inputs: Percent (5); variables: Text_ID2(0), onetick(0); onetick = minmove/pricescale; if C_Doji( Percent ) = 1 then begin Text_ID2 = Text_New( Date, Time, low-Txt_below_bar*onetick, My_TEXT ); text_setcolor( Text_ID2,long_clr) ; Text_SetStyle(Text_ID2, horizdown, vertdown); end;
  21. Sep34 & Sevensa: Many thanks, it now works the way I had hoped. In applying these variables (and learning easy language/power language), is it possible to use the same inputs for other candlestick patters, for example bullish/bearish engulfing, etc... or are the parameters for the doji unique?
  22. Sep34, thanks for the reply. This looks to be what i'm trying to accomplish; however, when I compile I get the below error, any thoughts? "assignment is allowed only for variables or array elements" Input: My_TEXT ("Doji"); Input: Txt_below_bar (2); Input: Long_Clr (magenta); Input: Horizdown (3); Input: Vertdown (2); inputs: Percent( 5 ) ; onetick = minmove/pricescale; if C_Doji( Percent ) = 1 then begin Text_ID2 = Text_New( Date, Time, low-Txt_below_bar*onetick, My_TEXT ); text_setcolor( Text_ID2,long_clr) ; Text_SetStyle(Text_ID2, horizdown, vertdown); end;
  23. I have fairly simple question (at least i think it is for anyone who codes). I'd like the following indicator to plot the text of the type of candlestick rather than dots. Below is from MC and this indicates doji. Looking to have the text display above/below the bar, thanks. inputs: Percent( 5 ) ; if C_Doji( Percent ) = 1 then begin Plot1( Close, "Doji" ) ; Alert( "Doji" ) ; end ;
  24. Sorry to beat this very dead horse... posted the code getting errors: '(' Expected errLine 13, errColumn 26, errLineEnd 13, errColumnEnd 26 For the record, i've downloaded and compiled all the other indicators with no issues, however my main squeeze seems to want nothing to do with me.
×
×
  • Create New...

Important Information

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