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.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

chipeur59700

Pivots

Recommended Posts

hi every body

 

i thank soultrader for code of pivots..

i add code to have quart middle pivots..see code above

 

i need help to have label and value of every pivot point like picture attached...

 

for every ligne the value on the right of the chart

 

thanks

 

 

chipeur

 

code for pivots ...

 

 

 

inputs:

DailyHigh( 0 ), DailyLow( 0 ), DailyClose( 0 ), WeeklyHigh( 0 ), WeeklyLow( 0 ), WeeklyClose( 0 ),

MonthlyHigh( 0 ), MonthlyLow( 0 ), MonthlyClose( 0 ), PlotDailyMidPts( true ),PlotDailyQuartMidPts(true),

PlotWeeklyMidPts( false ),

PlotMonthlyMidPts( false ), DailyR3color( red ), DailyR2color( Red ), DailyR1color( red ),

DailyPPcolor( blue ),

DailyS1color( darkgreen ), DailyS2color( darkgreen ), DailyS3color( darkgreen ), WeeklyR3color( Magenta ),

WeeklyR2color( Red ),

WeeklyR1color( Cyan ), WeeklyPPcolor( Yellow ), WeeklyS1color( Cyan ), WeeklyS2color( Red ),

WeeklyS3color( Magenta ),

MonthlyR3color( Magenta ), MonthlyR2color( Red ), MonthlyR1color( Cyan ), MonthlyPPcolor( Yellow ),

MonthlyS1color( Cyan ), MonthlyS2color( Red ), MonthlyS3color( Magenta ), DailyMidPtcolor( LightGray),

WeeklyMidPtcolor( Blue ), MonthlyMidPtcolor( LightGray ),DailyQuartMidPtcolor( Yellow),

PivotStyle( 2 ), // 1 = solid, 2 = dashed, 3 = dotted, 4 = Dashed2, 5 = dashed3

MidPtStyle( 3 ),

QuartMidPtStyle( 1 );

 

variables:

S1( 0 ), S2( 0 ), S3( 0 ),S4( 0 ), R1( 0 ), R2( 0 ), R3( 0 ),R4( 0 ), PP( 0 ), Rng( 0 ), TL_S1( 0 ),

TL_S2( 0 ), TL_S3( 0 ),TL_S4( 0 ), TL_R1( 0 ), TL_R2( 0 ), TL_R3( 0 ),TL_R4( 0 ), TL_PP( 0 ), TL_M1( 0 ), TL_M2( 0 ),

TL_M3( 0 ), TL_M4( 0 ), TL_M5( 0 ), TL_M6( 0 ),TL_M7( 0 ),TL_M8( 0 ), TL_M9( 0 ), TL_M10( 0 ),TL_M11( 0 ) ,

TL_M12( 0 ),TL_M13( 0 ),TL_M14( 0 ),TL_M15( 0 ),TL_M16( 0 ),TL_M17( 0 ),TL_M18( 0 ),

StartDate( 0 ), StartTime( 0 );

 

if CurrentBar = 1 then

begin

StartDate = Date;

StartTime = Time;

end;

 

if LastBarOnChart then

begin

// Daily Pivot Points

Rng = DailyHigh - DailyLow;

PP = (DailyHigh + DailyLow + DailyClose) / 3 ;

R1 = (2*PP) - DailyLow ;

R2 = PP + Rng ;

R3 = R1 + Rng;

R4 = R3 + Rng;

S1 = (2*PP) - DailyHigh ;

S2 = PP - Rng ;

S3 = S1 - Rng ;

S4 = S3 - Rng ;

 

 

TL_R4 = TL_New(StartDate, StartTime, R4, Date, Time, R4);

TL_SetColor(TL_R4, DailyR3color);

TL_SetStyle(TL_R4, PivotStyle);

TL_SetExtRight(TL_R4, True);

TL_R3 = TL_New(StartDate, StartTime, R3, Date, Time, R3);

TL_SetColor(TL_R3, DailyR3color);

TL_SetStyle(TL_R3, PivotStyle);

TL_SetExtRight(TL_R3, True);

TL_R2 = TL_New(StartDate, StartTime, R2, Date, Time, R2);

TL_SetColor(TL_R2, DailyR2color);

TL_SetStyle(TL_R2, PivotStyle);

TL_SetExtRight(TL_R2, True);

TL_R1 = TL_New(StartDate, StartTime, R1, Date, Time, R1);

TL_SetColor(TL_R1, DailyR1color);

TL_SetStyle(TL_R1, PivotStyle);

TL_SetExtRight(TL_R1, True);

TL_PP = TL_New(StartDate, StartTime, PP, Date, Time, PP);

TL_SetColor(TL_PP, DailyPPcolor);

TL_SetStyle(TL_PP, PivotStyle);

TL_SetExtRight(TL_PP, True);

TL_S1 = TL_New(StartDate, StartTime, S1, Date, Time, S1);

TL_SetColor(TL_S1, DailyS1color);

TL_SetStyle(TL_S1, PivotStyle);

TL_SetExtRight(TL_S1, True);

TL_S2 = TL_New(StartDate, StartTime, S2, Date, Time, S2);

TL_SetColor(TL_S2, DailyS2color);

TL_SetStyle(TL_S2, PivotStyle);

TL_SetExtRight(TL_S2, True);

TL_S3 = TL_New(StartDate, StartTime, S3, Date, Time, S3);

TL_SetColor(TL_S3, DailyS3color);

TL_SetStyle(TL_S3, PivotStyle);

TL_SetExtRight(TL_S3, True);

TL_S4 = TL_New(StartDate, StartTime, S4, Date, Time, S4);

TL_SetColor(TL_S4, DailyS3color);

TL_SetStyle(TL_S4, PivotStyle);

TL_SetExtRight(TL_S4, True);

 

 

If PlotDailyMidPts then

begin

TL_M1 = TL_New(StartDate, StartTime, (R2+R3)/2, Date, Time, (R2+R3)/2);

TL_SetColor(TL_M1, DailyMidPtcolor);

TL_SetStyle(TL_M1, MidPtStyle);

TL_SetExtRight(TL_M1, True);

TL_M2 = TL_New(StartDate, StartTime, (R1+R2)/2, Date, Time, (R1+R2)/2);

TL_SetColor(TL_M2, DailyMidPtcolor);

TL_SetStyle(TL_M2, MidptStyle);

TL_SetExtRight(TL_M2, True);

TL_M3 = TL_New(StartDate, StartTime, (PP+R1)/2, Date, Time, (PP+R1)/2);

TL_SetColor(TL_M3, DailyMidPtcolor);

TL_SetStyle(TL_M3, MidPtStyle);

TL_SetExtRight(TL_M3, True);

TL_M4 = TL_New(StartDate, StartTime, (S1+PP)/2, Date, Time, (S1+PP)/2);

TL_SetColor(TL_M4, DailyMidPtcolor);

TL_SetStyle(TL_M4, MidPtStyle);

TL_SetExtRight(TL_M4, True);

TL_M5 = TL_New(StartDate, StartTime, (S2+S1)/2, Date, Time, (S2+S1)/2);

TL_SetColor(TL_M5, DailyMidPtcolor);

TL_SetStyle(TL_M5, MidPtStyle);

TL_SetExtRight(TL_M5, True);

 

TL_M6 = TL_New(StartDate, StartTime, (S3+S2)/2, Date, Time, (S3+S2)/2);

TL_SetColor(TL_M6, DailyMidPtcolor);

TL_SetStyle(TL_M6, MidPtStyle);

TL_SetExtRight(TL_M6, True);

 

TL_M13 = TL_New(StartDate, StartTime, (S4+S3)/2, Date, Time, (S4+S3)/2);

TL_SetColor(TL_M13, DailyMidPtcolor);

TL_SetStyle(TL_M13, MidPtStyle);

TL_SetExtRight(TL_M13, True);

 

TL_M14 = TL_New(StartDate, StartTime, (R4+R3)/2, Date, Time, (R4+R3)/2);

TL_SetColor(TL_M14, DailyMidPtcolor);

TL_SetStyle(TL_M14, MidPtStyle);

TL_SetExtRight(TL_M14, True);

 

 

 

end;

 

//quart Pivots daily

 

if PlotDailyQuartMidPts then

begin

 

 

TL_M1 = TL_New(StartDate, StartTime,R2-(R2-R1)/4 , Date, Time, R2-(R2-R1)/4);

TL_SetColor(TL_M1,DailyQuartMidPtcolor );

TL_SetStyle(TL_M1, MidPtStyle);

TL_SetExtRight(TL_M1, True);

 

TL_M2 = TL_New(StartDate, StartTime,R1-(R1-R2)/4 , Date, Time,R1-(R1-R2)/4) ;

TL_SetColor(TL_M2,DailyQuartMidPtcolor );

TL_SetStyle(TL_M2, MidptStyle);

TL_SetExtRight(TL_M2, True);

 

TL_M3 = TL_New(StartDate, StartTime,R1-(R1-PP)/4 , Date, Time,R1-(R1-PP)/4) ;

TL_SetColor(TL_M3, DailyQuartMidPtcolor);

TL_SetStyle(TL_M3, MidPtStyle);

TL_SetExtRight(TL_M3, True);

 

TL_M4 = TL_New(StartDate, StartTime,PP+(R1-PP)/4 , Date, Time,PP+(R1-PP)/4);

TL_SetColor(TL_M4, DailyQuartMidPtcolor);

TL_SetStyle(TL_M4, MidPtStyle);

TL_SetExtRight(TL_M4, True);

 

TL_M5 = TL_New(StartDate, StartTime, PP-(PP-S1)/4, Date, Time, PP-(PP-S1)/4);

TL_SetColor(TL_M5, DailyQuartMidPtcolor);

TL_SetStyle(TL_M5, MidPtStyle);

TL_SetExtRight(TL_M5, True);

 

TL_M6 = TL_New(StartDate, StartTime, S1+(PP-S1)/4, Date, Time, S1+(PP-S1)/4);

TL_SetColor(TL_M6, DailyQuartMidPtcolor);

TL_SetStyle(TL_M6, MidPtStyle);

TL_SetExtRight(TL_M6, True);

 

TL_M7 = TL_New(StartDate, StartTime, S1+(S2-S1)/4, Date, Time, S1+(S2-S1)/4);

TL_SetColor(TL_M7, DailyQuartMidPtcolor);

TL_SetStyle(TL_M7, MidPtStyle);

TL_SetExtRight(TL_M7, True);

 

 

TL_M8 = TL_New(StartDate, StartTime,S2-(S2-S1)/4 , Date, Time,S2-(S2-S1)/4) ;

TL_SetColor(TL_M8, DailyQuartMidPtcolor);

TL_SetStyle(TL_M8, MidPtStyle);

TL_SetExtRight(TL_M8, True);

 

TL_M9 = TL_New(StartDate, StartTime,S2-(S2-S3)/4 , Date, Time,S2-(S2-S3)/4);

TL_SetColor(TL_M9, DailyQuartMidPtcolor);

TL_SetStyle(TL_M9, MidPtStyle);

TL_SetExtRight(TL_M9, True);

 

TL_M10 = TL_New(StartDate, StartTime, S3+(S2-S3)/4, Date, Time, S3+(S2-S3)/4);

TL_SetColor(TL_M10, DailyQuartMidPtcolor);

TL_SetStyle(TL_M10, MidPtStyle);

TL_SetExtRight(TL_M10, True);

 

TL_M11 = TL_New(StartDate, StartTime, R2+(R3-R2)/4, Date, Time, R2+(R3-R2)/4);

TL_SetColor(TL_M11, DailyQuartMidPtcolor);

TL_SetStyle(TL_M11, MidPtStyle);

TL_SetExtRight(TL_M11, True);

 

TL_M12 = TL_New(StartDate, StartTime, R3-(R3-R2)/4, Date, Time, R3-(R3-R2)/4);

TL_SetColor(TL_M12, DailyQuartMidPtcolor);

TL_SetStyle(TL_M12, MidPtStyle);

TL_SetExtRight(TL_M12, True);

 

TL_M15 = TL_New(StartDate, StartTime, R4-(R4-R3)/4, Date, Time, R4-(R4-R3)/4);

TL_SetColor(TL_M15, DailyQuartMidPtcolor);

TL_SetStyle(TL_M15, MidPtStyle);

TL_SetExtRight(TL_M15, True);

 

TL_M16 = TL_New(StartDate, StartTime, R3+(R4-R3)/4, Date, Time, R3+(R4-R3)/4);

TL_SetColor(TL_M16, DailyQuartMidPtcolor);

TL_SetStyle(TL_M16, MidPtStyle);

TL_SetExtRight(TL_M16, True);

 

TL_M17 = TL_New(StartDate, StartTime, S4+(S3-S4)/4, Date, Time, S4+(S3-S4)/4);

TL_SetColor(TL_M17, DailyQuartMidPtcolor);

TL_SetStyle(TL_M17, MidPtStyle);

TL_SetExtRight(TL_M17, True);

 

TL_M18 = TL_New(StartDate, StartTime, S3-(S3-S4)/4, Date, Time, S3-(S3-S4)/4);

TL_SetColor(TL_M18, DailyQuartMidPtcolor);

TL_SetStyle(TL_M18, MidPtStyle);

TL_SetExtRight(TL_M18, True);

 

 

 

 

 

end;

 

 

 

// Weekly Pivot Points

Rng = WeeklyHigh - WeeklyLow;

PP = (WeeklyHigh + WeeklyLow + WeeklyClose) / 3 ;

R1 = (2*PP) - WeeklyLow ;

R2 = PP + Rng ;

R3 = R1 + Rng;

S1 = (2*PP) - WeeklyHigh ;

S2 = PP - Rng ;

S3 = S1 - Rng ;

 

TL_R3 = TL_New(StartDate, StartTime, R3, Date, Time, R3);

TL_SetColor(TL_R3, WeeklyR3color);

TL_SetStyle(TL_R3, PivotStyle);

TL_SetExtRight(TL_R3, True);

TL_R2 = TL_New(StartDate, StartTime, R2, Date, Time, R2);

TL_SetColor(TL_R2, WeeklyR2color);

TL_SetStyle(TL_R2, PivotStyle);

TL_SetExtRight(TL_R2, True);

TL_R1 = TL_New(StartDate, StartTime, R1, Date, Time, R1);

TL_SetColor(TL_R1, WeeklyR1color);

TL_SetStyle(TL_R1, PivotStyle);

TL_SetExtRight(TL_R1, True);

TL_PP = TL_New(StartDate, StartTime, PP, Date, Time, PP);

TL_SetColor(TL_PP, WeeklyPPcolor);

TL_SetStyle(TL_PP, PivotStyle);

TL_SetExtRight(TL_PP, True);

TL_S1 = TL_New(StartDate, StartTime, S1, Date, Time, S1);

TL_SetColor(TL_S1, WeeklyS1color);

TL_SetStyle(TL_S1, PivotStyle);

TL_SetExtRight(TL_S1, True);

TL_S2 = TL_New(StartDate, StartTime, S2, Date, Time, S2);

TL_SetColor(TL_S2, WeeklyS2color);

TL_SetStyle(TL_S2, PivotStyle);

TL_SetExtRight(TL_S2, True);

TL_S3 = TL_New(StartDate, StartTime, S3, Date, Time, S3);

TL_SetColor(TL_S3, WeeklyS3color);

TL_SetStyle(TL_S3, PivotStyle);

TL_SetExtRight(TL_S3, True);

 

if PlotWeeklyMidPts then

begin

TL_M1 = TL_New(StartDate, StartTime, (R2+R3)/2, Date, Time, (R2+R3)/2);

TL_SetColor(TL_M1, WeeklyMidPtcolor);

TL_SetStyle(TL_M1, MidPtStyle);

TL_SetExtRight(TL_M1, True);

TL_M2 = TL_New(StartDate, StartTime, (R1+R2)/2, Date, Time, (R1+R2)/2);

TL_SetColor(TL_M2, WeeklyMidPtcolor);

TL_SetStyle(TL_M2, MidptStyle);

TL_SetExtRight(TL_M2, True);

TL_M3 = TL_New(StartDate, StartTime, (PP+R1)/2, Date, Time, (PP+R1)/2);

TL_SetColor(TL_M3, WeeklyMidPtcolor);

TL_SetStyle(TL_M3, MidPtStyle);

TL_SetExtRight(TL_M3, True);

TL_M4 = TL_New(StartDate, StartTime, (S1+PP)/2, Date, Time, (S1+PP)/2);

TL_SetColor(TL_M4, WeeklyMidPtcolor);

TL_SetStyle(TL_M4, MidPtStyle);

TL_SetExtRight(TL_M4, True);

TL_M5 = TL_New(StartDate, StartTime, (S2+S1)/2, Date, Time, (S2+S1)/2);

TL_SetColor(TL_M5, WeeklyMidPtcolor);

TL_SetStyle(TL_M5, MidPtStyle);

TL_SetExtRight(TL_M5, True);

TL_M6 = TL_New(StartDate, StartTime, (S3+S2)/2, Date, Time, (S3+S2)/2);

TL_SetColor(TL_M6, WeeklyMidPtcolor);

TL_SetStyle(TL_M6, MidPtStyle);

TL_SetExtRight(TL_M6, True);

end;

 

// Monthly Pivot Points

Rng = MonthlyHigh - MonthlyLow;

PP = (MonthlyHigh + MonthlyLow + MonthlyClose) / 3 ;

R1 = (2*PP) - MonthlyLow ;

R2 = PP + Rng ;

R3 = R1 + Rng;

S1 = (2*PP) - MonthlyHigh ;

S2 = PP - Rng ;

S3 = S1 - Rng ;

 

TL_R3 = TL_New(StartDate, StartTime, R3, Date, Time, R3);

TL_SetColor(TL_R3, MonthlyR3color);

TL_SetStyle(TL_R3, PivotStyle);

TL_SetExtRight(TL_R3, True);

TL_R2 = TL_New(StartDate, StartTime, R2, Date, Time, R2);

TL_SetColor(TL_R2, MonthlyR2color);

TL_SetStyle(TL_R2, PivotStyle);

TL_SetExtRight(TL_R2, True);

TL_R1 = TL_New(StartDate, StartTime, R1, Date, Time, R1);

TL_SetColor(TL_R1, MonthlyR1color);

TL_SetStyle(TL_R1, PivotStyle);

TL_SetExtRight(TL_R1, True);

TL_PP = TL_New(StartDate, StartTime, PP, Date, Time, PP);

TL_SetColor(TL_PP, MonthlyPPcolor);

TL_SetStyle(TL_PP, PivotStyle);

TL_SetExtRight(TL_PP, True);

TL_S1 = TL_New(StartDate, StartTime, S1, Date, Time, S1);

TL_SetColor(TL_S1, MonthlyS1color);

TL_SetStyle(TL_S1, PivotStyle);

TL_SetExtRight(TL_S1, True);

TL_S2 = TL_New(StartDate, StartTime, S2, Date, Time, S2);

TL_SetColor(TL_S2, MonthlyS2color);

TL_SetStyle(TL_S2, PivotStyle);

TL_SetExtRight(TL_S2, True);

TL_S3 = TL_New(StartDate, StartTime, S3, Date, Time, S3);

TL_SetColor(TL_S3, MonthlyS3color);

TL_SetStyle(TL_S3, PivotStyle);

TL_SetExtRight(TL_S3, True);

 

if PlotMonthlyMidPts then

begin

TL_M1 = TL_New(StartDate, StartTime, (R2+R3)/2, Date, Time, (R2+R3)/2);

TL_SetColor(TL_M1, MonthlyMidPtcolor);

TL_SetStyle(TL_M1, MidPtStyle);

TL_SetExtRight(TL_M1, True);

TL_M2 = TL_New(StartDate, StartTime, (R1+R2)/2, Date, Time, (R1+R2)/2);

TL_SetColor(TL_M2, MonthlyMidPtcolor);

TL_SetStyle(TL_M2, MidptStyle);

TL_SetExtRight(TL_M2, True);

TL_M3 = TL_New(StartDate, StartTime, (PP+R1)/2, Date, Time, (PP+R1)/2);

TL_SetColor(TL_M3, MonthlyMidPtcolor);

TL_SetStyle(TL_M3, MidPtStyle);

TL_SetExtRight(TL_M3, True);

TL_M4 = TL_New(StartDate, StartTime, (S1+PP)/2, Date, Time, (S1+PP)/2);

TL_SetColor(TL_M4, MonthlyMidPtcolor);

TL_SetStyle(TL_M4, MidPtStyle);

TL_SetExtRight(TL_M4, True);

TL_M5 = TL_New(StartDate, StartTime, (S2+S1)/2, Date, Time, (S2+S1)/2);

TL_SetColor(TL_M5, MonthlyMidPtcolor);

TL_SetStyle(TL_M5, MidPtStyle);

TL_SetExtRight(TL_M5, True);

TL_M6 = TL_New(StartDate, StartTime, (S3+S2)/2, Date, Time, (S3+S2)/2);

TL_SetColor(TL_M6, MonthlyMidPtcolor);

TL_SetStyle(TL_M6, MidPtStyle);

TL_SetExtRight(TL_M6, True);

end;

end;

ATPRO.jpg.c03fbacf5190348fead41af183eac132.jpg

Share this post


Link to post
Share on other sites

 

Hi Tams

thanks very much for the post. I have in fact already found the ABC floor pivots indicator. I really like it but i'd like to make my own tweaks to it.

 

There are two things i would really like to do to this indicator, but don't know how. :( I'd really appreciate anyones help.

 

1) To display the prices (as well as the label, e.g. 27.93 RR2) at each floor level

 

2) To have it plot the levels in anticipation of the forthcoming period, i.e. at the end of trading today, to plot the levels in the clear space at the end of the chart where the tomorrow's bars will plot. Otherwise you still have manually calculate the forthcming pivot levels and add them to the chart (or simply bear them in mind), which is far from ideal.

 

I don't know if anyone has already done this, or knows how to?

Cheers

Syn

Share this post


Link to post
Share on other sites

Here's the bit from my pivot study you just need to change the variables to match yours

 

if ShowLabels then

begin

 

{ only show for today }

// If Date = CurrentDate and Time>= Sess1StartTime and Time <= sess1endtime - BarInterval then

Begin

 

TextPP = Text_New( Date, Time, PP, "PP " + NumToStr( PP, DecP) ) ;

Text_SetStyle( TextPP, 1, 1 ) ;

Text_SetColor(TextPP, PCol);

 

TextS1 = Text_New( Date, Time, S1, "S1 " + NumToStr( S1, DecP) ) ;

Text_SetStyle( TextS1, 1, 1 ) ;

Text_SetColor(TextS1, PCol);

 

TextS2 = Text_New( Date, Time, S2, "S2 " + NumToStr( S2, DecP) ) ;

Text_SetStyle( TextS2, 1, 1 ) ;

Text_SetColor(TextS2, PCol);

 

TextS3 = Text_New( Date, Time, S3, "S3 " + NumToStr( S3, DecP) ) ;

Text_SetStyle( TextS3, 1, 1 ) ;

Text_SetColor(TextS3, PCol);

 

TextS4 = Text_New( Date, Time, S4, "S4 " + NumToStr( S4, DecP) ) ;

Text_SetStyle( TextS4, 1, 1 ) ;

Text_SetColor(TextS4, PCol);

 

TextS5 = Text_New( Date, Time, S5, "S5 " + NumToStr( S5, DecP) ) ;

Text_SetStyle( TextS5, 1, 1 ) ;

Text_SetColor(TextS5, PCol);

 

TextR1 = Text_New( Date, Time, R1, "R1 " + NumToStr( R1, DecP) ) ;

Text_SetStyle( TextR1, 1, 1 ) ;

Text_SetColor(TextR1, PCol);

 

TextR2 = Text_New( Date, Time, R2, "R2 " + NumToStr( R2, DecP) ) ;

Text_SetStyle( TextR2, 1, 1 ) ;

Text_SetColor(TextR2, PCol);

 

TextR3 = Text_New( Date, Time, R3, "R3 " + NumToStr( R3, DecP) ) ;

Text_SetStyle( TextR3, 1, 1 ) ;

Text_SetColor(TextR3, PCol);

 

TextR4 = Text_New( Date, Time, R4, "R4 " + NumToStr( R4, DecP) ) ;

Text_SetStyle( TextR4, 1, 1 ) ;

Text_SetColor(TextR4, PCol);

 

TextR5 = Text_New( Date, Time, R5, "R5 " + NumToStr( R5, DecP) ) ;

Text_SetStyle( TextR5, 1, 1 ) ;

Text_SetColor(TextR5, PCol);

 

if showmidpoints=true then

begin

 

TextMPS1 = Text_New( Date, Time, MPS1, "S0.5 " + NumToStr( MPS1, DecP) ) ;

Text_SetStyle( TextMPS1, 1, 1 ) ;

Text_SetColor(TextMPS1, MidCol);

 

TextMPS2 = Text_New( Date, Time, MPS2, "S1.5 " + NumToStr( MPS2, DecP) ) ;

Text_SetStyle( TextMPS2, 1, 1 ) ;

Text_SetColor(TextMPS2, MidCol);

 

TextMPS3 = Text_New( Date, Time, MPS3, "S2.5 " + NumToStr( MPS3, DecP) ) ;

Text_SetStyle( TextMPS3, 1, 1 ) ;

Text_SetColor(TextMPS3, MidCol);

 

TextMPR1 = Text_New( Date, Time, MPR1, "R0.5 " + NumToStr( MPR1, DecP) ) ;

Text_SetStyle( TextMPR1, 1, 1 ) ;

Text_SetColor(TextMPR1, MidCol);

 

TextMPR2 = Text_New( Date, Time, MPR2, "R1.5 " + NumToStr( MPR2, DecP) ) ;

Text_SetStyle( TextMPR2, 1, 1 ) ;

Text_SetColor(TextMPR2, MidCol);

 

TextMPR3 = Text_New( Date, Time, MPR3, "R2.5 " + NumToStr( MPR3, DecP) ) ;

Text_SetStyle( TextMPR3, 1, 1 ) ;

Text_SetColor(TextMPR3, MidCol);

 

end;

 

end;

end;

end;

end;

 

if ShowLabels then

begin

 

text_setlocation(textPP,date,currenttime-HorizontalOffset,PP);

text_setlocation(textS1,date,currenttime-HorizontalOffset,S1);

text_setlocation(textS2,date,currenttime-HorizontalOffset,S2);

text_setlocation(textS3,date,currenttime-HorizontalOffset,S3);

text_setlocation(textS4,date,currenttime-HorizontalOffset,S4);

text_setlocation(textS5,date,currenttime-HorizontalOffset,S5);

text_setlocation(textR1,date,currenttime-HorizontalOffset,R1);

text_setlocation(textR2,date,currenttime-HorizontalOffset,R2);

text_setlocation(textR3,date,currenttime-HorizontalOffset,R3);

text_setlocation(textR4,date,currenttime-HorizontalOffset,R4);

text_setlocation(textR5,date,currenttime-HorizontalOffset,R5);

 

if showmidpoints then

begin

text_setlocation(textMPS1,date,currenttime-HorizontalOffset,MPS1);

text_setlocation(textMPS2,date,currenttime-HorizontalOffset,MPS2);

text_setlocation(textMPS3,date,currenttime-HorizontalOffset,MPS3);

text_setlocation(textMPR1,date,currenttime-HorizontalOffset,MPR1);

text_setlocation(textMPR2,date,currenttime-HorizontalOffset,MPR2);

text_setlocation(textMPR3,date,currenttime-HorizontalOffset,MPR3);

end;

end;

end;

Share this post


Link to post
Share on other sites

Hi Harlequin

thanks for posting your code! Given that i'm a complete newcomer to coding, it doesn't mean much to me at the moment! But it gives me something to work with.

Cheers

S

Share this post


Link to post
Share on other sites

I learnt to code Basic on ZX81 when I was a kid, unfortunately my skill level hasn't improved since. I just borrowed bits from other pivot studies I found here and else where on the web.

 

Hope it helps.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • Be careful who you blame.   I can tell you one thing for sure.   Effective traders don’t blame others when things start to go wrong.   You can hang onto your tendency to play the victim, or the martyr… but if you want to achieve in trading, you have to be prepared to take responsibility.   People assign reasons to outcomes, whether based on internal or external factors.   When traders face losses, it's common for them to blame bad luck, poor advice, or other external factors, rather than reflecting on their own personal attributes like arrogance, fear, or greed.   This is a challenging lesson to grasp in your trading journey, but one that holds immense value.   This is called attribution theory. Taking responsibility for your actions is the key to improving your trading skills. Pause and ask yourself - What role did I play in my financial decisions?   After all, you were the one who listened to that source, and decided to act on that trade based on the rumour. Attributing results solely to external circumstances is what is known as having an ‘external locus of control’.   It's a concept coined by psychologist Julian Rotter in 1954. A trader with an external locus of control might say, "I made a profit because the markets are currently favourable."   Instead, strive to develop an "internal locus of control" and take ownership of your actions.   Assume that all trading results are within your realm of responsibility and actively seek ways to improve your own behaviour.   This is the fastest route to enhancing your trading abilities. A trader with an internal locus of control might proudly state, "My equity curve is rising because I am a disciplined trader who faithfully follows my trading plan." Author: Louise Bedford Source: https://www.tradinggame.com.au/
    • SELF IMPROVEMENT.   The whole self-help industry began when Dale Carnegie published How to Win Friends and Influence People in 1936. Then came other classics like Think And Grow Rich by Napoleon Hill, Awaken the Giant Within by Tony Robbins toward the end of the century.   Today, teaching people how to improve themselves is a business. A pure ruthless business where some people sell utter bullshit.   There are broke Instagrammers and YouTubers with literally no solid background teaching men how to be attractive to women, how to begin a start-up, how to become successful — most of these guys speaking nothing more than hollow motivational words and cliche stuff. They waste your time. Some of these people who present themselves as hugely successful also give talks and write books.   There are so many books on financial advice, self-improvement, love, etc and some people actually try to read them. They are a waste of time, mostly.   When you start reading a dozen books on finance you realize that they all say the same stuff.   You are not going to live forever in the learning phase. Don't procrastinate by reading bull-shit or the same good knowledge in 10 books. What we ought to do is choose wisely.   Yes. A good book can change your life, given you do what it asks you to do.   All the books I have named up to now are worthy of reading. Tim Ferriss, Simon Sinek, Robert Greene — these guys are worthy of reading. These guys teach what others don't. Their books are unique and actually, come from relevant and successful people.   When Richard Branson writes a book about entrepreneurship, go read it. Every line in that book is said by one of the greatest entrepreneurs of our time.   When a Chinese millionaire( he claims to be) Youtuber who releases a video titled “Why reading books keeps you broke” and a year later another one “My recommendation of books for grand success” you should be wise to tell him to jump from Victoria Falls.   These self-improvement gurus sell you delusions.   They say they have those little tricks that only they know that if you use, everything in your life will be perfect. Those little tricks. We are just “making of a to-do-list before sleeping” away from becoming the next Bill Gates.   There are no little tricks.   There is no success-mantra.   Self-improvement is a trap for 99% of the people. You can't do that unless you are very, very strong.   If you are looking for easy ways, you will only keep wasting your time forgetting that your time on this planet is limited, as alive humans that is.   Also, I feel that people who claim to read like a book a day or promote it are idiots. You retain nothing. When you do read a good book, you read slow, sometimes a whole paragraph, again and again, dwelling on it, trying to internalize its knowledge. You try to understand. You think. It takes time.   It's better to read a good book 10 times than 1000 stupid ones.   So be choosy. Read from the guys who actually know something, not some wannabe ‘influencers’.   Edit: Think And Grow Rich was written as a result of a project assigned to Napoleon Hill by Andrew Carnegie(the 2nd richest man in recent history). He was asked to study the most successful people on the planet and document which characteristics made them great. He did extensive work in studying hundreds of the most successful people of that time. The result was that little book.   Nowadays some people just study Instagram algorithms and think of themselves as a Dale Carnegie or Anthony Robbins. By Nupur Nishant, Quora Profits from free accurate cryptos signals: https://www.predictmag.com/    
    • there is no avoiding loses to be honest, its just how the market is. you win some and hopefully more, but u do lose some. 
    • $CSCO Cisco Systems stock, nice top of range breakout, from Stocks to Watch at https://stockconsultant.com/?CSCOSEPN Septerna stock watch for a bottom breakout, good upside price gap
    • $CSCO Cisco Systems stock, nice top of range breakout, from Stocks to Watch at https://stockconsultant.com/?CSCOSEPN Septerna stock watch for a bottom breakout, good upside price gap
×
×
  • Create New...

Important Information

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