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.

PeterBrazel

Members
  • Content Count

    54
  • Joined

  • Last visited

Everything posted by PeterBrazel

  1. Suri, Thank you very much. I will try to work out why this is so and try to get an understanding of your solution to this issue. As you can see I am not much of a codey. In the meantime this result is exactly what I set out to achieve. All the assistance on this forum is first rate and appreciated.
  2. {jtHMA - Hull Moving Average Indicator} {Author: Atavachron} {May 2005} { Inputs: ------- price: the time series being smoothed, usually Close, High, etc, but could be RSI(Close, 25) for example. length: the length of the MA, pretty meaningless in the normal sense of moving averages, as this quantity is heavily modified in the code. You need to experiment, do not just use a setting of 20 because that is what works for you with Simple Moving Averages. zeroLine: if you are using this in an indicator pane, you might want to display a centre line of some sort, ths allows one to set its value zeroVisible: boolean variable, determines whether the centre line (zeroLine) is plotted. upColour: If you wish to differentiate upward movements by colour coding. downColour: If you wish to differentiate downward movements by colour coding. colourDeltaBar: Set this to 1 if you wish the colour change to be effective on the actual bar where the direction change occurred. Set this to 0 for default behaviour. All other values are pretty meaningless. } Inputs: price(Close), length(21), zeroLine(0.0), zeroVisible(false), upColour(Blue), 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);
  3. I do not want to plot the jtHMA as a line on my chart. I want to plot only a single dot above the bar where the MA turns down and a single dot below the bar where the MA turns up. This is the only information that I need from this indicator.
  4. did you copy the whole thing in post #6? !!!!Yes I did can you draw a mock up to illustrate how you want it plot? !!!Attached Refer to the Blue/Red HMA. Yellow dots are what our code produces. Arrows is where I want the dots to plot.
  5. Yes I cut and pasted the code as in post 6. Attached is a screen capture of a chart. Ignore the larger time frame multi coloured MA and have a look at the jtHMA which is the red and blue coloured MA. I have marked up and down arrows at the location at which the jtHMA changes colour. This is all the information I need on my chart. The yellow dots represent the output using the code as per your post 6. This code appears very straight forward but something is causing these multiple plots. Thanks
  6. Thanks once again. I copied your code but the result is unchanged.
  7. Sorry...here is the attachment
  8. Special thanks for all the assistance you have given me over various posts Tams. Whilst my programming skills are very weak you have assisted me to struggle through several issues such that I have ultimately achieved my original objective with several indicators. My current issue relates an adaption of the jtHMA to have showme's plotted only when the the MA changes from up to down and vice versa. This code: "Displace >= 0 or CurrentBar > AbsValue( Displace ) then " was lifted directly from the jtHMA code. Commenting it out does not seem to change my output result one way or other, that I can see. I am getting plots above and below each bar rather than just on the bar where the MA changes from up to down and vice versa. I have attached a screenshot of my code and the output.
  9. I have constructed the following code that I want to plot only on a direction chane in the average: If PlotSlow=True and Displace >= 0 or CurrentBar > AbsValue( Displace ) then begin If Value2[2]<=Value2[1] and Value2>=Value2[1] then Plot6(Low-Offset,"Up") else if Value2[2]>Value2[1] and (Value2 < Value2[1]) then Plot7(High+Offset,"Dn") else NoPlot(6); I only want a single plot when the condition is true but I get plots most of the time. Where am I wrong here. Cannot see the forest for the trees sort of question.
  10. Anybody know how to do this. For example I have a number of say 1.4565 and want to display it on a chart as part of a text object with this number converted to 565. Should be pretty simple but cannot find it anywhere.
  11. No my initial code changes color only from blue to red depending on the value of the prior plot in relation to the current plot. The outcome of what I want to achieve is very very basic. If the indicator is sloping up and price is above it then it should plot blue [upcolor]. If it is sloping down and price is below it it should plot red [dncolor]. If the indicator is flat and or prices are closing either side of it and or on it then plot the indicator yellow [ncolor]. Thanks,
  12. Attached is a mock up but is very basic. I was travelling all day yesterday. Thanks for the help logging into TS Forum that is fixed workiong on TS fix. I will check out the code above to see what I can achieve with it as soon as I get TS working. Thank you everybody thus far with assistance.
  13. Tams, No offence intended on my part. My education did not extend to year twelve so my knowledge of mathematics is admittedly quite limited. I certainly appreciate your help. Sorry I cannot post a mock up at this point in time as I am unable to access my charts because of a TS login issue. I will do so as soon as I can. In the meantime I am just trying to achieve an indicator that changes color based on its slope and that the extent of the slope that initiates the color change is triggered by a user input variable such as a percent increase or decrease. Thanks.
  14. Tams, Good grief man...are you a maths guru. I will have to digest this. I am sure you understand what I am trying to do here. Unfortunately I cannot log onto TS at the moment as I keep getting a Com file not initialized at the log in prompt so I cannot show you on a chart what I want to happen. I also cannot access anything from the TS forum. I can log on but as soon as I do a search it throws me back out to the support page. Not sure what the hell is going on there. I think if I can just program a variable for the color change and then just adjust that variable until I get the visual I desire that should do the trick although maybe it is not that simple. Seems as though I will not have access to me charting until I can contact TS support.
  15. An upward sloping MA indicates an uptrend condition. A downward sloping MA indicates a downtrend condition. A flat MA indicates an area of congestion. I think the condition that changes the color would have to be one of percentages, that is unless an angle can be defined. Having trouble with attachment. Will include in seperate post. Thanks
  16. The above code is a work in progress and currently changes color ONLY dependent on the MA being either > or < the prior close. I would like to change this to make it dependent on the slope of the MA [input].
  17. [LegacyColorValue = false]; {*************************Peter's MA Slope Indicator********************************* This indicator seeks to plot color changes on an MA indicator according to the slope of an MA. *************************************************************************************} inputs: Price( Close ), Length( 9 ), Displace( 0 ), colourDeltaBar(1), UpColor(blue), DnColor(red), NColor(yellow); variables: var0( 0 ) ; Value1 = AverageFC( Price, Length ) ; Plot1(Value1, "MA Neutral"); {***********Color change criteria*************** } if (Value1 > Value1[2]) then SetPlotColor[colourDeltaBar](1, upColor) else if (Value1 < Value1[2]) then SetPlotColor[colourDeltaBar](1, dnColor); if Displace <= 0 then begin condition1 = Price crosses over var0 ; if condition1 then Alert( "Price crossing over average" ) else begin condition1 = Price crosses under var0 ; if condition1 then Alert( "Price crossing under average" ) ; end ; end;
  18. I am trying to either get hold of code or code myself an MA indicator that changes color depending on the slope of the MA. Say maybe blue for up trending red for downtrending and yellow for flat. I have adjusted the code of an MA to give two colors depending on the plot being > or < than the prior but I am a little stumped on working out exactly how I could achieve the slope measurement that I require. I have had a bit of a look around and cannot locate where this has been done before. I would have thought someone would have posted one somewhere as the codies out there are very good at this sort of stuff, unlike me. But step by step I guess. Any ideas?
  19. Thank you. I have it fixed now. Can you suggest the best learning material for EL. I have seen the TS Home Study Offer but it seems expensive for a book on EL and not sure what the quality of the learning experience would be with it. Have you had any experience with it or do you have any other suggestions? Thanks for all your assistance. Cheers
  20. Sorry cannot see where my brackets are mismatched.
  21. Yes xAvg = XAverage (LineA, LinRegAvg) ;
  22. Tams, Thanks but I keep getting this highlighted at the t on the then after xAvg ------ Compiled with error(s): ------ syntax error, unexpected 'then' errLine 59, errColumn 38, errLineEnd 59, errColumnEnd 38
  23. I am having trouble getting this to work. 1) LineA sloping down 2) C<xAvg If either of these are true go test for all the others and if they are true give me the plot. Any ideas....thanks {************* Showme Study **************} {Continuation Sell} IF((LineA <= LineA[1])or Close < xAvg and (oSlowK[1]>OverSold and oSlowK[1]>oSlowD and oSlowK<oSlowK[1] then begin Plot6(H,"DnColor",Dncolor); end else begin
  24. Thanks. It is not the Hawkeye Indicator that I am interested in, it is the method of achieving the output to plot in this manner using EL. It turned out to be a very simple adjustment to the switch on the plot statement. You provided me with exactly the information I was seeking. I really appreciate your assistance with this.
  25. Thanks very much. Actually it was the "1" switch. I was using Plot1(0, etcetc). Changed it to 1 and everything is fine. Thanks again.
×
×
  • Create New...

Important Information

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