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.

kamakazy

Members
  • Content Count

    25
  • Joined

  • Last visited

Personal Information

  • First Name
    TradersLaboratory.com
  • Last Name
    User
  • City
    london
  • Country
    United Kingdom
  • Gender
    Male

Trading Information

  • Vendor
    No
  1. ok! is there an easy way to do this? Is there any reference to this as i cant find any. Anyone here done this? Anything to beware of?
  2. Thanks pretty damn amazing, thank you so much..
  3. ok i have once again edited my code! Obviously Tams is either getting annoyed or does not know anser so does anyone else. Im usually ok at sorting these out myself but this countertrend thing has got the best of me!!!! I need an alert for loss of momentum and if a countertrend fires off! here is my code //if CustomerID = 784793 and CurrentDate < 1100101 then begin Inputs: Price(Close), price2(close),Price3(H/3+L/3+C/3), Length(20), Length2(13), Length3(21), Length4(9), nK(1.5), nBB(2), AlertLine( 1 ), BuyColor1(green), BuyColor2(darkgreen), SellColor1(red), SellColor2(darkred), NormalColor(Red),AlertColor(Green), CounterTrend(true); vars:FastVal1(0), SlowVal1(0), Diff1(0), FastVal2(0), SlowVal2(0), Diff2(0), FastVal3(0), SlowVal3(0), Diff3(0), FastVal4(0), SlowVal4(0), Diff4(0), AvgDiff(0), AvgDif(0), poles(4), CCIValue(0),DownCT(0),UpCT(0),SDev(0),ATR(0),LHMult(0),Denom(0),BBS_Ind(0); {Histogram 101} FastVal1 = SqFunc(price, 8, poles); SlowVal1 = SqFunc(price, 21, poles); Diff1 = FastVal1 - SlowVal1; FastVal2 = SqFunc(price, 13, poles); SlowVal2 = SqFunc(price, 34, poles); Diff2 = FastVal2 - SlowVal2; FastVal3 = SqFunc(price, 21, poles); SlowVal3 = SqFunc(price, 55, poles); Diff3 = FastVal3 - SlowVal3; FastVal4 = SqFunc(price, 34, poles); SlowVal4 = SqFunc(price, 89, poles); Diff4 = FastVal4 - SlowVal4; AvgDiff = (Diff1+Diff2+Diff3+Diff4)/4; plot2(AvgDiff,"DiffHisto") ; if AvgDiff > 0 then if AvgDiff > AvgDiff[1] then setplotcolor(2,BuyColor1) else setplotcolor(2,BuyColor2) ; if AvgDiff < 0 then if AvgDiff < AvgDiff[1] then setplotcolor(2,SellColor1) else setplotcolor(2,SellColor2); { Counter Trend Mode 101} if CounterTrend = true then begin CCiValue = CCI(13); Condition1 = ccivalue[1] > 50; Condition2 = CCivalue < 50; Condition3 = CCivalue[1] < 100; Condition4 = CCiValue > 100; Condition5 = AvgDiff > 0; Condition6 = AvgDiff[1] > 0; Condition7 = AvgDiff[2] > 0; Condition8 = ccivalue < 100; if Condition1 and Condition2 and Condition5 and condition6 and condition7 then begin setplotcolor(2,SellColor2); DownCT = 1; end; if DownCT = 1 and AvgDiff < 0 then DownCT =0; if DownCT = 1 and Condition8 and Condition5 then setplotcolor(2,SellColor2); {test1} if DownCT = 1 and Condition3 and Condition4 then begin setplotcolor(2,BuyColor1); DownCT = 0; end; Condition11 = ccivalue[1] < -50; Condition12 = CCivalue > -50; Condition13 = CCivalue[1] >- 100; Condition14 = CCiValue < -100; Condition15 = AvgDiff < 0; Condition16 = AvgDiff[1] < 0; Condition17 = AvgDiff[2] < 0; Condition18 = ccivalue >-100; {next} if Condition11 and Condition12 and Condition15 and condition16 and condition17 then begin setplotcolor(2,BuyColor2) ; UpCT = 1; end; {bottom} if UpCT = 1 and AvgDiff > 0 then UpCT =0; if UpCT = 1 and Condition18 and Condition15 then setplotcolor(2,BuyColor2) ; if UpCT = 1 and Condition13 and Condition14 then begin setplotcolor(2,SellColor1); UpCT = 0; if Condition11 and Condition12 and Condition15 and condition16 and condition17 then Alert("Next"); if UpCT = 1 and AvgDiff > 0 then UpCT =0; if UpCT = 1 and Condition18 and Condition15 then Alert("Bottom"); if UpCT = 1 and Condition13 and Condition14 then Alert("Bottom 2"); if DownCT = 1 and Condition3 and Condition4 then Alert ("test1"); if DownCT = 1 and Condition8 and Condition5 then Alert ("test2"); end; end; end; i have added this to try and get some alerts firing to troubleshoot {bottom} if UpCT = 1 and AvgDiff > 0 then UpCT =0; if UpCT = 1 and Condition18 and Condition15 then setplotcolor(2,BuyColor2) ; if UpCT = 1 and Condition13 and Condition14 then begin setplotcolor(2,SellColor1); UpCT = 0; if Condition11 and Condition12 and Condition15 and condition16 and condition17 then Alert("Next"); if UpCT = 1 and AvgDiff > 0 then UpCT =0; if UpCT = 1 and Condition18 and Condition15 then Alert("Bottom"); if UpCT = 1 and Condition13 and Condition14 then Alert("Bottom 2"); if DownCT = 1 and Condition3 and Condition4 then Alert ("test1"); if DownCT = 1 and Condition8 and Condition5 then Alert ("test2"); but i get nothing! I need coutertrend but i just want an alert for 4 thing Loss of momentum long loss of momentum short countertrend long countertrend short If need be ill pay someone this has bugged me for a week!
  4. hmm though it seems to work ok if i turn off countertrtend mode!!
  5. yea have been for 2 weeks¬ if your talking about if AvgDiff > 0 then I have tried that it does nothing different!
  6. yes its enabled and firing off!!!! BUT It fires off even when the squeeze is the wrong colour! If its green i still get a short alert!
  7. sorry its not in that i added it to the bottom, i just wanted to put up the original code before i added the alert! I added if AvgDiff < AvgDiff[1] then Alert ( "Short" ); to the bottom of the file before the, end;
  8. Hi i would like to set an alert up when the squeeze fires off but only for buycolour1 and sellcour1.. here is the squeeze code im using Inputs: Price(Close), price2(close),Price3(H/3+L/3+C/3), Length(20), Length2(13), Length3(21), Length4(9), Style(1), nK(1.5), nBB(2), AlertLine( 1 ), BuyColor1(blue), BuyColor2(darkblue), SellColor1(red), SellColor2(darkred), NormalColor(Red),AlertColor(Blue), CounterTrend(true); vars:FastVal1(0), SlowVal1(0), Diff1(0), FastVal2(0), SlowVal2(0), Diff2(0), FastVal3(0), SlowVal3(0), Diff3(0), FastVal4(0), SlowVal4(0), Diff4(0), AvgDiff(0), AvgDif(0), poles(4), CCIValue(0),DownCT(0),UpCT(0),SDev(0),ATR(0),LHMult(0),Denom(0),BBS_Ind(0); if Style = 0 then begin {Zero Line - BB Squeeze} if ( barnumber=1 ) then Begin If minmove <> 0 then LHMult = pricescale/minmove; end; {-- Calculate BB Squeeze ----------------------} ATR = AvgTrueRange(Length); SDev = StandardDev(Price, Length, 1); Denom = (nK*ATR); If Denom <> 0 then BBS_Ind = (nBB * SDev) /Denom; If BBS_Ind < Alertline then SetPlotColor(1, NormalColor) else SetPlotColor(1, AlertColor); {-- Plot Index & Alert Line -------------------------} Plot1(0, "Squeeze"); end; if Style = 1 then begin {Zero Line - Gauss filter} value1 = Gauss(Price3,Length3,3); if (Value1) > (Value1[1]) then SetPlotColor(1, BuyColor1); if (Value1) < (Value1[1]) then SetPlotColor(1, SellColor1); //SetPlotWidth(1,7); Plot1(0, "Squeeze"); end; {Histogram} FastVal1 = Gauss(price, 8, poles); SlowVal1 = Gauss(price, 21, poles); Diff1 = FastVal1 - SlowVal1; FastVal2 = Gauss(price, 13, poles); SlowVal2 = Gauss(price, 34, poles); Diff2 = FastVal2 - SlowVal2; FastVal3 = Gauss(price, 21, poles); SlowVal3 = Gauss(price, 55, poles); Diff3 = FastVal3 - SlowVal3; FastVal4 = Gauss(price, 34, poles); SlowVal4 = Gauss(price, 89, poles); Diff4 = FastVal4 - SlowVal4; AvgDiff = (Diff1+Diff2+Diff3+Diff4)/4; plot2(AvgDiff,"DiffHisto") ; //setplotwidth(2,7); if AvgDiff > 0 then if AvgDiff > AvgDiff[1] then setplotcolor(2,BuyColor1) else setplotcolor(2,BuyColor2) ; if AvgDiff < 0 then if AvgDiff < AvgDiff[1] then setplotcolor(2,SellColor1) else setplotcolor(2,SellColor2); {+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++} { Counter Trend Mode} if CounterTrend = true then begin CCiValue = CCI(13); Condition1 = ccivalue[1] > 50; Condition2 = CCivalue < 50; Condition3 = CCivalue[1] < 100; Condition4 = CCiValue > 100; Condition5 = AvgDiff > 0; Condition6 = AvgDiff[1] > 0; Condition7 = AvgDiff[2] > 0; Condition8 = ccivalue < 100; if Condition1 and Condition2 and Condition5 and condition6 and condition7 then begin setplotcolor(2,SellColor2); DownCT = 1; end; if DownCT = 1 and AvgDiff < 0 then DownCT =0; if DownCT = 1 and Condition8 and Condition5 then setplotcolor(2,SellColor2); if DownCT = 1 and Condition3 and Condition4 then begin setplotcolor(2,BuyColor1); DownCT = 0; end; Condition11 = ccivalue[1] < -50; Condition12 = CCivalue > -50; Condition13 = CCivalue[1] >- 100; Condition14 = CCiValue < -100; Condition15 = AvgDiff < 0; Condition16 = AvgDiff[1] < 0; Condition17 = AvgDiff[2] < 0; Condition18 = ccivalue >-100; if Condition11 and Condition12 and Condition15 and condition16 and condition17 then begin setplotcolor(2,BuyColor2) ; UpCT = 1; end; if UpCT = 1 and AvgDiff > 0 then UpCT =0; if UpCT = 1 and Condition18 and Condition15 then setplotcolor(2,BuyColor2) ; if UpCT = 1 and Condition13 and Condition14 then begin setplotcolor(2,SellColor1); UpCT = 0; end; 08704870334 end; I have tried the following if AvgDiff < AvgDiff[1] then Alert ( "Short" ); but its not working, anyone know how to alert for this? Thanks
  9. ok cool, that makes sence! If i do this, is there anyway that i can set the subgraphs these indicators should plot on from Code? Thanks
  10. Hi, if i have 3 indicators on my chart can I get one indicator to check the status of another indicator? if (Value1 > Value1[1]) then Alert("go long"); if value1 is not on the indicator with this code? If not how can i set the subgraph an indicator is on in EL? Thanks
  11. hi there i have done that though it now looks abit strange!! I think its because data1 is 5min and data2 is 60 min and the 60 min line does not know what to do on a 5 min timframe!! I have attatched the pic, the light blue patches should not be there, is there anyway to sort this? Thanks chris
  12. ok, so i have modified my code and actually got somewhere!!!! Now there is just one small problem I get gaps in the line, you can see them blue... Any ideas what they are and how i can stop this Here is the code and the pic!! Inputs: price(Close), price2(Close data2), length(9), zeroVisible(false), upColour(Blue), downColour(White),upColour2(Green), downColour2(Red), colourDeltaBar(1); Value1 = jthma(price, length); Value2 = jthma(price2, length); Plot1(Value1,"jthma"); Plot2(Value2,"jthma2"); { Color criteria } if (Value1 > Value1[1]) then SetPlotColor[colourDeltaBar](1, upColour) else if (Value1 < Value1[1]) then SetPlotColor[colourDeltaBar](1, downColour); if (Value2 > Value2[2]) then SetPlotColor[colourDeltaBar](2, upColour2) else if (Value2 < Value2[2]) then SetPlotColor[colourDeltaBar](2, downColour2); end;
  13. hello there, Thanks for that, very nice instructions my friend. its nice but not exactly what i want Ill explain and hopefully you can help!! Basically the screaming moving average uses jthma to create a line which changes colour on the trend direction! I use this to catch trades on a 15 min chart, i usually have a 60 min open as well as an anchor chart to check this matches the 15. (if both my jthma lines are magenta i long it) Now what i want is the have the 60 min line also on my 15 min chart so i have the 60 min and 15 min jthma line on the chart. If they are both magenta ill long if they are both white ill short!! It does work but now i just need them both on same chart! Thanks
  14. ok ill try again, with the original code Inputs: price(Close), length(21), zeroLine(0.0), zeroVisible(false), upColour(Green), downColour(Red), colourDeltaBar(1); Value1 = jtHMA(price, length); Plot1(Value1, "jtHMA"); If ZeroVisible = true then Plot2(zeroLine, "Zero"); { Color criteria } if (Value1 > Value1[1]) then SetPlotColor[colourDeltaBar](1, upColour) else if (Value1 < Value1[1]) then SetPlotColor[colourDeltaBar](1, downColour); i have tried a number of things first i tried changing value 1 Value1 = jtHMA(price, length) data2; which then did this to the line (the blue and white one is correct and from data1) then i tried changing the price input to: Inputs: price(Close data2) this just changed the whole line to red!! All i want it the same line twice on the same chart one pulling data1 and the other data2. Im not getting very far! Thanks again Tams
×
×
  • Create New...

Important Information

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