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.

BigEd

Marketprofile.eld

Recommended Posts

Your most likely getting an array bound error ... if so

Change the compress input in this manor, increas that input by 1 until the profile is ploted.

 

note: by doing that your telling the indicator to combine X ticks as one tick.

where x = the number of the compress input your using.

 

Or

your using TS costum sessions charts... if so the code as is will not work with costum sessions charts.

 

 

Take care

sep34

 

I am having that same problem as well. I get an a array bound. Wrong index value: 1001 I tried increasing the compress input by one. Yet I didn't get to get it working...as a matter of fact I am using tick-by-tick data thru a mapped ascii file...is it because of that?

 

thanks

Share this post


Link to post
Share on other sites

While this indicator seems to display correclty, can anyone tell me why the arrays start saving data at the 443rd position (according to the TS print window)? I also want to calculate POC - is there an easier way than to dump the extreme position of the tpo array into a new dynamic array and include the appropriate logic to arrive at POC? Thanks.

Share this post


Link to post
Share on other sites

Here is POC function..

 

 

 

vars: PriceBin(.50),

TimeBin(0),

Unit4Accum(0),

TypAccum(0),

BegTime1(0),

BegTime2(0),

BegTime3(0),

DoHoriz(True),

Perc4VA(70),

LineSize(1);

{Begin Comment Out for Signal}

 

vars:

PointRight(True),{If set false then display will point to left }

 

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

 

BegDate(0);{Date on which to start analysis. 0=All }

{this is used to limit the number of analyses that are }

{made and may be necessary -- particularly in TS7/8... }

{to keep "infinite loop" error from occurring. }

 

 

 

{must replace Vars: with in the word INPUT: here for an indicator}

 

vars:

OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

 

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

 

OnlyHist(false), {Do not make MP for current day until next day. }

 

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

 

PlotOpen(True); {Plot open of current analysis -- green dotted line }

 

 

Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=UnionSess1StartTime),

LowBox(0), DateKnt(0), HKnt(0),

ATR21(AvgTrueRange(21)),

Bin4Price(Iff(PriceBin>ATR21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),

LowValue(LowBox*Bin4Price), IPass(0),

Bin4Time(AbsValue(IntPortion(TimeBin))),

ShiftIt((AbsValue(TimeBin)-Bin4Time)*100),

HighValue(H),TotalKnt(0),

HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);

Vars: TimeBeg1(Iff(BegTime1<25,IntPortion(BegTime1)*100+FracPortion(BegTime1)*60,BegTime1)),

TimeBeg2(Iff(BegTime2<25,IntPortion(BegTime2)*100+FracPortion(BegTime2)*60,BegTime2)),

TimeBeg3(Iff(BegTime3<25,IntPortion(BegTime3)*100+FracPortion(BegTime3)*60,BegTime3));

Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);

Vars: VAHighValue(h), VALowValue(l),VAPivot©,

VAPerc(Iff(Perc4VA>0,Perc4VA/100,.7)),

CurrentMin(TimeToMinutes(time)), EntryP(0);

Vars: VAHighOld(0), VAHighNew(0),

VALowOld(0), VALowNew(0),

VABarOld(0), VABarNew(0),

VADateOld(0), VADateNew(0),

VATimeOld(0), VATimeNew(0),

DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),

HandlHi(-1), HandlLo(-1), HandlCP(-1),

CanBuy(false),CanSell(false),DoInit(True);

 

{Begin comment out for Indicator

Vars: LossMaxPts(LossMax/BigPointValue),

TakProfPts(TakProf/BigPointValue);

End comment out for Indicator}

 

Vars: ATR21Val(0), MP(0),

StopHH(0), StopLL(0), EnterBar(0),

MaxCont(0), NCont(0), HoldDate(Date-1);

Vars: PDPtrn(0);

 

 

Vars: MaxKnt(15000), Direct(0), DoKnt(0);

Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);

 

 

If DoInit then begin

DoInit=False;

Value1=AvgTrueRange(21)/10;

If PriceBin=0 then Bin4Price=Value1

else Bin4Price=PriceBin;

 

LowBox = Round(L/Bin4Price,0);

End;

 

LBOC = LastBarOnChart;

If Date<>Date[1] and TimeBin=0 then NewDate=Date;

 

 

{For system remove I_}

If MP<>MP[1] then begin

EntryP=O;

EnterBar=CurrentBar;

StopHH=H;

StopLL=L;

End;

 

If Date>=BegDate then begin

 

 

 

If (TimeBin>0 and Unit4Accum>0) then begin

Condition1=false;

Condition3=false;

If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1;

If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1;

If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;

If Unit4Accum=4 then begin

For Value1 = 0 to 3 begin

Value2=Value1*3+1;

If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;

End;

End;

If Unit4Accum=5 then begin

DoKnt=0;

 

Value0=AbsValue(IntPortion(Direct));

If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin

Condition1=True;

Condition3=Condition1;

If Direct[1]=0 then begin

HoldBar=CurrentBar-Value0;

HoldAdd=HoldBar-OldHoldBar;

End

Else begin

If LBOC and Sign(Direct)=Sign(Direct[1]) then begin

If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;

HoldBar=CurrentBar;

Value0=0;

End

Else begin

OldHoldBar=HoldBar;

HoldBar=CurrentBar-Value0;

End;

 

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);

Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);

LowBox =Round(Value3/Bin4Price,0);

TotalKnt=Round(Value2/Bin4Price,0)-LowBox;

LowValue=LowBox*Bin4Price;

HoldAdd=HoldBar-OldHoldBar;

LowBox =0;

While TotalKnt<8 begin

Bin4Price=Bin4Price/2;

LowBox =Round(Value3/Bin4Price,0);

TotalKnt=Round(Value2/Bin4Price,0)-LowBox;

LowValue=LowBox*Bin4Price;

LowBox =0;

End;

For Value1 = LowBox to TotalKnt begin

Value3=Value1 * Bin4Price + LowValue;

PriceKnt[Value1]=0;

For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin

If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;

End;

End;

End;

End;

End;

If DoKnt>=TimeBin then begin

Condition1=True;

Condition3=Condition1;

DoKnt=0;

End;

End

Else begin

Condition1=false;

Condition3=false;

If TimeBin>0 then begin

If TimeBeg1=0

then CurrentMin=TimeToMinutes(time)-TimeToMinutes(Sess1FirstBarTime)

else CurrentMin=TimeToMinutes(time)-TimeToMinutes(TimeBeg1);

If CurrentMin<0 then CurrentMin=CurrentMin+TimeToMinutes(2359)+1;

If CurrentMin<0 then CurrentMin=CurrentMin+24*60;

Condition1=Mod(CurrentMin,TimeBin)<Mod(CurrentMin[1],TimeBin);

Condition3=Condition1;

End

Else begin

If TimeBin<0 then begin

If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4Time);

Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;

Condition3=Condition1;

End

Else begin

If DataCompression>1 then begin

If ShiftIt>13 then ShiftIt=0;

Condition1=Mod(CurrentBar-ShiftIt,13)=0;

Condition3=Condition1;

End

Else Begin

Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);

If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;

If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;

If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;

If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>=Addtime(Sess1EndTime,-5)) then Condition1=True;

Condition3=Condition1;

End;

End;

End;

End;

If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

 

If Condition1 then begin

 

If Condition1 or CurrentBar=1 then begin

CanBuy=True;

CanSell=True;

DateKnt=DateKnt+1;

If LBOC=False or Condition3 then OpenOfDay=Open;

End;

 

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin

Value3=Round(Low/Bin4Price,0);

If Value3<LowBox and Value3<>0 then begin

Value2=LowBox-Value3;

For Value1= 2000-Value2 downto 0 begin

PriceKnt[Value1+Value2]=PriceKnt[Value1];

PriceKnt[Value1]=0;

End;

LowBox =Value3;

LowValue=LowBox*Bin4Price;

TotalKnt=TotalKnt+Value2;

End;

Value2=Round(Low/Bin4Price,0) -LowBox;

Value3=Round(High/Bin4Price,0) -LowBox;

For Value1=Value2 to Value3 begin

PriceKnt[Value1]=PriceKnt[Value1]+1;

End;

If Value3>TotalKnt then TotalKnt=Value3;

End;

 

If TotalKnt>1 and DateKnt>1 then begin

MaxValue=-99999;

SumValue=0;

{Find the max value and sum up the price occupancies}

Value99=0;

For Value1=0 to TotalKnt begin

Value4=PriceKnt[Value1];

If Value4>0 then Value99=Value1;

SumValue=SumValue+Value4;

If Value4>=MaxValue then begin

MaxIndex=Value1;

MaxValue=Value4;

End;

End;

{Find all alike and setup CP at middle}

Value2=0;

For Value1=0 to TotalKnt begin

If PriceKnt[Value1]=MaxValue then Value2=Value2+1;

End;

If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

 

{Now find the Value Area (70% of total counts)}

VAHigh=MaxIndex;

VALow =MaxIndex;

Value9=PriceKnt[MaxIndex];

Value10=0;

While Value9<=IntPortion(SumValue*VAPerc) begin

Value10=Value10+1;

If MaxIndex-Value10>=0 and Value9<=IntPortion(SumValue*VAPerc) then begin

VALow =MaxIndex-Value10;

Value9=Value9+PriceKnt[VALow];

End;

If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumValue*VAPerc) then begin

VAHigh=MaxIndex+Value10;

Value9=Value9+PriceKnt[VAHigh];

End;

End;

 

VAHighValue=LowValue+VAHigh *Bin4Price;

VALowValue =LowValue+VALow *Bin4Price;

VAPivot =LowValue+MaxIndex*Bin4Price;

Value1=0;

VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];

VALowOld=VALowNew; VALowNew=VALowValue[Value1];

VADateOld=VADateNew; VADateNew=Date[Value1];

VATimeOld=VATimeNew; VATimeNew=Time[Value1];

VABarOld=VABarNew; VABarNew=CurrentBar;

 

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt

else PDPtrn=0;

PDPtrn=Round(PDPtrn*4,0);

 

If DateKnt>2 then begin

 

Value2=LowValue;

If PointRight then Value6=CurrentBar-HoldBar+HoldAdd

else Value6=HoldAdd;

 

{Now plot the data and highlight VA}

If DateKnt>3 then begin

 

If LBOC then begin

for Value1=0 to TotalKnt begin

If Handl[Value1]<>0 then begin

TL_Delete(Handl[Value1]);

Handl[Value1]=0;

End;

End;

End;

 

 

HKnt=0;

For Value1=0 to TotalKnt begin

Value4=PriceKnt[Value1];

If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;

If Value4>0 and Value5<MaxKnt then begin

If DoHoriz then begin

{Value2=(LowBox+Value1)*Bin4Price;}

If PointRight

Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)

Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);

Value7=Blue;

If LBOC then Handl[Value1]=Value5;

If Value1<VALow then value7=red;

If Value1>VAHigh then value7=yellow;

If Value1=MaxIndex then value7=Red;

Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);

End;

If AnotHLCP then begin

If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin

If PointRight then Value30=-Value4 else Value30=0;

If Value1=VALow then begin

If HandlLo>=0 then Text_Delete(HandlLo);

HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2));

Text_SetStyle(HandlLo,0,2);

End;

If Value1=VAHigh then begin

If HandlHi>=0 then Text_Delete(HandlHi);

HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2));

Text_SetStyle(HandlHi,0,2);

End;

If Value1=MaxIndex then begin

If HandlCP>=0 then Text_Delete(HandlCP);

HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2)+"--"+NumToStr(PDPtrn,0));

Text_SetStyle(HandlCP,0,2);

End;

End;

End;

End;

Value2=Value2+Bin4Price;

End;

 

If DoChan and Value5<4500 then begin

Value3=TL_NEW(VADateOld,VATimeOld,VAHighOld,VADateNew,VATimeNew,VAHighNew);

Value4=TL_NEW(VADateOld,VATimeOld,VALowOld, VADateNew,VATimeNew,VALowNew);

Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);

Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);

End;

End;

 

 

Condition5=True;

If TimeBin<>0 then begin

If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;

If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;

If (TypAccum=-1 and Time<>Sess1StartTime+BarInterval) then Condition5=False;

End;

If LBOC=False then begin

If Condition5 then begin

For Value1=0 to 2000 begin

PriceKnt[Value1]=0;

End;

TotalKnt=0;

LowBox =Round(Low/Bin4Price,0);

LowValue=LowBox*Bin4Price;

End;

If Unit4Accum<>5 then HoldBar =CurrentBar;

IPASS=Time;

End;

End;

End;

If LBOC then KeepBar=CurrentBar;

End;

 

If DateKnt>1 then begin

 

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

 

If Smooth=0 then begin

Value17=VAHighNew;

Value18=VALowNew;

End

Else begin

If Condition1 then begin

Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);

Value19=.5/(VABarNew-VABarOld);

End;

Value14=(CurrentBar-VABarNew);

Value16=Value15*Value14*Smooth*(1-Value14*Value19);

Value17=VAHighNew+Value16;

Value18=VALowNew +Value16;

End;

 

 

{Remove right brace for SIGNAL -- add for INDICATOR}

If LBOC then begin

Value2=-MaxBarsForward;

Value3=-1;

{If KeepBar=0 then OpenOfDay=C;}

If Smooth=0 then begin

 

 

End;

End

else begin

Value27=Value17;

Value28=Value18;

Value29=VAPivot;

Value2=0;

Value3=0;

If Unit4Accum=5 then Value3=Value6;

End;

 

 

 

End;

If HandlHi>-1 then begin

Text_SetLocation(HandlHi,Date,Time,Value17);

Text_SetLocation(HandlCP,Date,Time,VAPivot{Value29});

Text_SetLocation(HandlLo,Date,Time,Value18);

End;

 

End;

 

End;

 

 

 

If Condition3 and (OnlyLast=False) then begin

HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);

End;

 

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin

Value3=Round(Low/Bin4Price,0);

If Value3<LowBox and Value3<>0 then begin

Value2=LowBox-Value3;

For Value1= 2000-Value2 downto 0 begin

PriceKnt[Value1+Value2]=PriceKnt[Value1];

PriceKnt[Value1]=0;

End;

LowBox =Value3;

LowValue=LowBox*Bin4Price;

TotalKnt=TotalKnt+Value2;

End;

Value2=Round(Low/Bin4Price,0) -LowBox;

Value3=Round(High/Bin4Price,0) -LowBox;

For Value1=Value2 to Value3 begin

PriceKnt[Value1]=PriceKnt[Value1]+1;

End;

If Value3>TotalKnt then TotalKnt=Value3;

End;

 

 

 

{end date loop}

 

 

 

 

poc=vapivot;

 

 

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites
vars: PriceBin(.50),
TimeBin(0),
Unit4Accum(0),
TypAccum(0),
BegTime1(0),
BegTime2(0),
BegTime3(0),
DoHoriz(True),
Perc4VA(70),
LineSize(1);
{Begin Comment Out for Signal}

vars:
PointRight(True),{If set false then display will point to left }

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

BegDate(0);{Date on which to start analysis. 0=All }
{this is used to limit the number of analyses that are }
{made and may be necessary -- particularly in TS7/8... }
{to keep "infinite loop" error from occurring. }



{must replace Vars: with in the word INPUT: here for an indicator}

vars:
OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

OnlyHist(false), {Do not make MP for current day until next day. }

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

PlotOpen(True); {Plot open of current analysis -- green dotted line }


Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=Un ionSess1StartTime),
LowBox(0), DateKnt(0), HKnt(0),
ATR21(AvgTrueRange(21)),
Bin4Price(Iff(PriceBin>AT R21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),
LowValue(LowBox*Bin4Price ), IPass(0),
Bin4Time(AbsValue(IntPort ion(TimeBin))),
ShiftIt((AbsValue(TimeBin )-Bin4Time)*100),
HighValue(H),TotalKnt(0),
HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);
Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)),
TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)),
TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3));
Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);
Vars: VAHighValue(h), VALowValue(l),VAPivot(c),
VAPerc(Iff(Perc4VA>0,Perc 4VA/100,.7)),
CurrentMin(TimeToMinutes( time)), EntryP(0);
Vars: VAHighOld(0), VAHighNew(0),
VALowOld(0), VALowNew(0),
VABarOld(0), VABarNew(0),
VADateOld(0), VADateNew(0),
VATimeOld(0), VATimeNew(0),
DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),
HandlHi(-1), HandlLo(-1), HandlCP(-1),
CanBuy(false),CanSell(fal se),DoInit(True);

{Begin comment out for Indicator
Vars: LossMaxPts(LossMax/BigPointValue),
TakProfPts(TakProf/BigPointValue);
End comment out for Indicator}

Vars: ATR21Val(0), MP(0),
StopHH(0), StopLL(0), EnterBar(0),
MaxCont(0), NCont(0), HoldDate(Date-1);
Vars: PDPtrn(0);


Vars: MaxKnt(15000), Direct(0), DoKnt(0);
Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);


If DoInit then begin
DoInit=False;
Value1=AvgTrueRange(21)/10;
If PriceBin=0 then Bin4Price=Value1
else Bin4Price=PriceBin;

LowBox = Round(L/Bin4Price,0);
End;

LBOC = LastBarOnChart;
If Date<>Date[1] and TimeBin=0 then NewDate=Date;


{For system remove I_}
If MP<>MP[1] then begin
EntryP=O;
EnterBar=CurrentBar;
StopHH=H;
StopLL=L;
End;

If Date>=BegDate then begin



If (TimeBin>0 and Unit4Accum>0) then begin
Condition1=false;
Condition3=false;
If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1;
If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1;
If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;
If Unit4Accum=4 then begin
For Value1 = 0 to 3 begin
Value2=Value1*3+1;
If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;
End;
End;
If Unit4Accum=5 then begin
DoKnt=0;

Value0=AbsValue(IntPortio n(Direct));
If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin
Condition1=True;
Condition3=Condition1;
If Direct[1]=0 then begin
HoldBar=CurrentBar-Value0;
HoldAdd=HoldBar-OldHoldBar;
End
Else begin
If LBOC and Sign(Direct)=Sign(Direct[1]) then begin
If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;
HoldBar=CurrentBar;
Value0=0;
End
Else begin
OldHoldBar=HoldBar;
HoldBar=CurrentBar-Value0;
End;

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);
Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
HoldAdd=HoldBar-OldHoldBar;
LowBox =0;
While TotalKnt<8 begin
Bin4Price=Bin4Price/2;
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
LowBox =0;
End;
For Value1 = LowBox to TotalKnt begin
Value3=Value1 * Bin4Price + LowValue;
PriceKnt[Value1]=0;
For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin
If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
End;
End;
End;
End;
If DoKnt>=TimeBin then begin
Condition1=True;
Condition3=Condition1;
DoKnt=0;
End;
End
Else begin
Condition1=false;
Condition3=false;
If TimeBin>0 then begin
If TimeBeg1=0
then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstB arTime)
else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1);
If CurrentMin<0 then CurrentMin=CurrentMin+Tim eToMinutes(2359)+1;
If CurrentMin<0 then CurrentMin=CurrentMin+24* 60;
Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin);
Condition3=Condition1;
End
Else begin
If TimeBin<0 then begin
If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4T ime);
Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;
Condition3=Condition1;
End
Else begin
If DataCompression>1 then begin
If ShiftIt>13 then ShiftIt=0;
Condition1=Mod(CurrentBar-ShiftIt,13)=0;
Condition3=Condition1;
End
Else Begin
Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);
If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;
If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;
If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;
If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>=Addtime(Sess1EndTim e,-5)) then Condition1=True;
Condition3=Condition1;
End;
End;
End;
End;
If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

If Condition1 then begin

If Condition1 or CurrentBar=1 then begin
CanBuy=True;
CanSell=True;
DateKnt=DateKnt+1;
If LBOC=False or Condition3 then OpenOfDay=Open;
End;

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;

If TotalKnt>1 and DateKnt>1 then begin
MaxValue=-99999;
SumValue=0;
{Find the max value and sum up the price occupancies}
Value99=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If Value4>0 then Value99=Value1;
SumValue=SumValue+Value4;
If Value4>=MaxValue then begin
MaxIndex=Value1;
MaxValue=Value4;
End;
End;
{Find all alike and setup CP at middle}
Value2=0;
For Value1=0 to TotalKnt begin
If PriceKnt[Value1]=MaxValue then Value2=Value2+1;
End;
If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

{Now find the Value Area (70% of total counts)}
VAHigh=MaxIndex;
VALow =MaxIndex;
Value9=PriceKnt[MaxIndex];
Value10=0;
While Value9<=IntPortion(SumVal ue*VAPerc) begin
Value10=Value10+1;
If MaxIndex-Value10>=0 and Value9<=IntPortion(SumVal ue*VAPerc) then begin
VALow =MaxIndex-Value10;
Value9=Value9+PriceKnt[VALow];
End;
If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumVal ue*VAPerc) then begin
VAHigh=MaxIndex+Value10;
Value9=Value9+PriceKnt[VAHigh];
End;
End;

VAHighValue=LowValue+VAHi gh *Bin4Price;
VALowValue =LowValue+VALow *Bin4Price;
VAPivot =LowValue+MaxIndex*Bin4Pr ice;
Value1=0;
VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];
VALowOld=VALowNew; VALowNew=VALowValue[Value1];
VADateOld=VADateNew; VADateNew=Date[Value1];
VATimeOld=VATimeNew; VATimeNew=Time[Value1];
VABarOld=VABarNew; VABarNew=CurrentBar;

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt
else PDPtrn=0;
PDPtrn=Round(PDPtrn*4,0);

If DateKnt>2 then begin

Value2=LowValue;
If PointRight then Value6=CurrentBar-HoldBar+HoldAdd
else Value6=HoldAdd;

{Now plot the data and highlight VA}
If DateKnt>3 then begin

If LBOC then begin
for Value1=0 to TotalKnt begin
If Handl[Value1]<>0 then begin
TL_Delete(Handl[Value1]);
Handl[Value1]=0;
End;
End;
End;


HKnt=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;
If Value4>0 and Value5<MaxKnt then begin
If DoHoriz then begin
{Value2=(LowBox+Value1)*B in4Price;}
If PointRight
Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)
Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);
Value7=Blue;
If LBOC then Handl[Value1]=Value5;
If Value1<VALow then value7=red;
If Value1>VAHigh then value7=yellow;
If Value1=MaxIndex then value7=Red;
Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);
End;
If AnotHLCP then begin
If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin
If PointRight then Value30=-Value4 else Value30=0;
If Value1=VALow then begin
If HandlLo>=0 then Text_Delete(HandlLo);
HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlLo,0,2 );
End;
If Value1=VAHigh then begin
If HandlHi>=0 then Text_Delete(HandlHi);
HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlHi,0,2 );
End;
If Value1=MaxIndex then begin
If HandlCP>=0 then Text_Delete(HandlCP);
HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ;
Text_SetStyle(HandlCP,0,2 );
End;
End;
End;
End;
Value2=Value2+Bin4Price;
End;

If DoChan and Value5<4500 then begin
Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADate New,VATimeNew,VAHighNew);
Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALow New);
Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);
Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);
End;
End;


Condition5=True;
If TimeBin<>0 then begin
If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;
If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;
If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False;
End;
If LBOC=False then begin
If Condition5 then begin
For Value1=0 to 2000 begin
PriceKnt[Value1]=0;
End;
TotalKnt=0;
LowBox =Round(Low/Bin4Price,0);
LowValue=LowBox*Bin4Price ;
End;
If Unit4Accum<>5 then HoldBar =CurrentBar;
IPASS=Time;
End;
End;
End;
If LBOC then KeepBar=CurrentBar;
End;

If DateKnt>1 then begin

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

If Smooth=0 then begin
Value17=VAHighNew;
Value18=VALowNew;
End
Else begin
If Condition1 then begin
Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);
Value19=.5/(VABarNew-VABarOld);
End;
Value14=(CurrentBar-VABarNew);
Value16=Value15*Value14*S mooth*(1-Value14*Value19);
Value17=VAHighNew+Value16 ;
Value18=VALowNew +Value16;
End;


{Remove right brace for SIGNAL -- add for INDICATOR}
If LBOC then begin
Value2=-MaxBarsForward;
Value3=-1;
{If KeepBar=0 then OpenOfDay=C;}
If Smooth=0 then begin


End;
End
else begin
Value27=Value17;
Value28=Value18;
Value29=VAPivot;
Value2=0;
Value3=0;
If Unit4Accum=5 then Value3=Value6;
End;



End;
If HandlHi>-1 then begin
Text_SetLocation(HandlHi, Date,Time,Value17);
Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 });
Text_SetLocation(HandlLo, Date,Time,Value18);
End;

End;

End;



If Condition3 and (OnlyLast=False) then begin
HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);
End;

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;



{end date loop}




poc=vapivot;

Share this post


Link to post
Share on other sites

Nice Code - too complicated for my small brain.:)

I do not understand your TL_SetAll. Is it a function or is it used in MC?

Without there is something important missing ,I believe.

 

Regs

Jojo

Share this post


Link to post
Share on other sites

Hi, alex_laxya

this is great stuff, too bad will not work without the two missing functions:

 

poc and TL_SetAll

 

any chance you may post those as well?

That would be wonderful :))))

 

If not thank you anyway will try to build them myself although I am not sure what TL_SetAll is supposed to do :(

 

IO

Share this post


Link to post
Share on other sites

I have fixed many syntex errors except the two things:

 

AddTime( )

TL_SetAll( )

 

It seems that there are functions, or reserved word not recognized by current version of TS 9.1

 

 

vars: PriceBin(.50),
TimeBin(0),
Unit4Accum(0),
TypAccum(0),
BegTime1(0),
BegTime2(0),
BegTime3(0),
DoHoriz(True),
Perc4VA(70),
LineSize(1);
{Begin Comment Out for Signal}

vars:
PointRight(True),{If set false then display will point to left }

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

BegDate(0);{Date on which to start analysis. 0=All }
{this is used to limit the number of analyses that are }
{made and may be necessary -- particularly in TS7/8... }
{to keep "infinite loop" error from occurring. }



{must replace Vars: with in the word INPUT: here for an indicator}

vars:
OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

OnlyHist(false), {Do not make MP for current day until next day. }

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

PlotOpen(True); {Plot open of current analysis -- green dotted line }


Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=UnionSess1StartTime),
LowBox(0), DateKnt(0), HKnt(0),
ATR21(AvgTrueRange(21)),
Bin4Price(Iff(PriceBin>ATR21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),
LowValue(LowBox*Bin4Price ), IPass(0),
Bin4Time(AbsValue(IntPortion(TimeBin))),
ShiftIt((AbsValue(TimeBin )-Bin4Time)*100),
HighValue(H),TotalKnt(0),
HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);
Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)),
TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)),
TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3));
Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);
Vars: VAHighValue(h), VALowValue(l),VAPivot(c),
VAPerc(Iff(Perc4VA>0,Perc4VA/100,.7)),
CurrentMin(TimeToMinutes( time)), EntryP(0);
Vars: VAHighOld(0), VAHighNew(0),
VALowOld(0), VALowNew(0),
VABarOld(0), VABarNew(0),
VADateOld(0), VADateNew(0),
VATimeOld(0), VATimeNew(0),
DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),
HandlHi(-1), HandlLo(-1), HandlCP(-1),
CanBuy(false),CanSell(false),DoInit(True);

{Begin comment out for Indicator
Vars: LossMaxPts(LossMax/BigPointValue),
TakProfPts(TakProf/BigPointValue);
End comment out for Indicator}

Vars: ATR21Val(0), MP(0),
StopHH(0), StopLL(0), EnterBar(0),
MaxCont(0), NCont(0), HoldDate(Date-1);
Vars: PDPtrn(0);


Vars: MaxKnt(15000), Direct(0), DoKnt(0);
Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);


If DoInit then begin
DoInit=False;
Value1=AvgTrueRange(21)/10;
If PriceBin=0 then Bin4Price=Value1
else Bin4Price=PriceBin;

LowBox = Round(L/Bin4Price,0);
End;

LBOC = LastBarOnChart;
If Date<>Date[1] and TimeBin=0 then NewDate=Date;


{For system remove I_}
If MP<>MP[1] then begin
EntryP=O;
EnterBar=CurrentBar;
StopHH=H;
StopLL=L;
End;

If Date>=BegDate then begin



If (TimeBin>0 and Unit4Accum>0) then begin
Condition1=false;
Condition3=false;
If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1;
If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1;
If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;
If Unit4Accum=4 then begin
For Value1 = 0 to 3 begin
Value2=Value1*3+1;
If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;
End;
End;
If Unit4Accum=5 then begin
DoKnt=0;

Value0=AbsValue(IntPortion(Direct));
If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin
Condition1=True;
Condition3=Condition1;
If Direct[1]=0 then begin
HoldBar=CurrentBar-Value0;
HoldAdd=HoldBar-OldHoldBar;
End
Else begin
If LBOC and Sign(Direct)=Sign(Direct[1]) then begin
If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;
HoldBar=CurrentBar;
Value0=0;
End
Else begin
OldHoldBar=HoldBar;
HoldBar=CurrentBar-Value0;
End;

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);
Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
HoldAdd=HoldBar-OldHoldBar;
LowBox =0;
While TotalKnt<8 begin
Bin4Price=Bin4Price/2;
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
LowBox =0;
End;
For Value1 = LowBox to TotalKnt begin
Value3=Value1 * Bin4Price + LowValue;
PriceKnt[Value1]=0;
For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin
If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
End;
End;
End;
End;
If DoKnt>=TimeBin then begin
Condition1=True;
Condition3=Condition1;
DoKnt=0;
End;
End
Else begin
Condition1=false;
Condition3=false;
If TimeBin>0 then begin
If TimeBeg1=0
then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstBarTime)
else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1);
If CurrentMin<0 then CurrentMin=CurrentMin+TimeToMinutes(2359)+1;
If CurrentMin<0 then CurrentMin=CurrentMin+24* 60;
Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin);
Condition3=Condition1;
End
Else begin
If TimeBin<0 then begin
If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4Time);
Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;
Condition3=Condition1;
End
Else begin
If DataCompression>1 then begin
If ShiftIt>13 then ShiftIt=0;
Condition1=Mod(CurrentBar-ShiftIt,13)=0;
Condition3=Condition1;
End
Else Begin
Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);
If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;
If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;
If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;
If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>={Addtime(}Sess1EndTime{,-5))}) then Condition1=True;
Condition3=Condition1;
End;
End;
End;
End;
If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

If Condition1 then begin

If Condition1 or CurrentBar=1 then begin
CanBuy=True;
CanSell=True;
DateKnt=DateKnt+1;
If LBOC=False or Condition3 then OpenOfDay=Open;
End;

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;

If TotalKnt>1 and DateKnt>1 then begin
MaxValue=-99999;
SumValue=0;
{Find the max value and sum up the price occupancies}
Value99=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If Value4>0 then Value99=Value1;
SumValue=SumValue+Value4;
If Value4>=MaxValue then begin
MaxIndex=Value1;
MaxValue=Value4;
End;
End;
{Find all alike and setup CP at middle}
Value2=0;
For Value1=0 to TotalKnt begin
If PriceKnt[Value1]=MaxValue then Value2=Value2+1;
End;
If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

{Now find the Value Area (70% of total counts)}
VAHigh=MaxIndex;
VALow =MaxIndex;
Value9=PriceKnt[MaxIndex];
Value10=0;
While Value9<=IntPortion(SumValue*VAPerc) begin
Value10=Value10+1;
If MaxIndex-Value10>=0 and Value9<=IntPortion(SumValue*VAPerc) then begin
VALow =MaxIndex-Value10;
Value9=Value9+PriceKnt[VALow];
End;
If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumValue*VAPerc) then begin
VAHigh=MaxIndex+Value10;
Value9=Value9+PriceKnt[VAHigh];
End;
End;

VAHighValue=LowValue+VAHigh *Bin4Price;
VALowValue =LowValue+VALow *Bin4Price;
VAPivot =LowValue+MaxIndex*Bin4Price;
Value1=0;
VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];
VALowOld=VALowNew; VALowNew=VALowValue[Value1];
VADateOld=VADateNew; VADateNew=Date[Value1];
VATimeOld=VATimeNew; VATimeNew=Time[Value1];
VABarOld=VABarNew; VABarNew=CurrentBar;

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt
else PDPtrn=0;
PDPtrn=Round(PDPtrn*4,0);

If DateKnt>2 then begin

Value2=LowValue;
If PointRight then Value6=CurrentBar-HoldBar+HoldAdd
else Value6=HoldAdd;

{Now plot the data and highlight VA}
If DateKnt>3 then begin

If LBOC then begin
for Value1=0 to TotalKnt begin
If Handl[Value1]<>0 then begin
TL_Delete(Handl[Value1]);
Handl[Value1]=0;
End;
End;
End;


HKnt=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;
If Value4>0 and Value5<MaxKnt then begin
If DoHoriz then begin
{Value2=(LowBox+Value1)*B in4Price;}
If PointRight
Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)
Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);
Value7=Blue;
If LBOC then Handl[Value1]=Value5;
If Value1<VALow then value7=red;
If Value1>VAHigh then value7=yellow;
If Value1=MaxIndex then value7=Red;
Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);
End;
If AnotHLCP then begin
If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin
If PointRight then Value30=-Value4 else Value30=0;
If Value1=VALow then begin
If HandlLo>=0 then Text_Delete(HandlLo);
HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlLo,0,2 );
End;
If Value1=VAHigh then begin
If HandlHi>=0 then Text_Delete(HandlHi);
HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlHi,0,2 );
End;
If Value1=MaxIndex then begin
If HandlCP>=0 then Text_Delete(HandlCP);
HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ;
Text_SetStyle(HandlCP,0,2 );
End;
End;
End;
End;
Value2=Value2+Bin4Price;
End;

If DoChan and Value5<4500 then begin
Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADateNew,VATimeNew,VAHighNew);
Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALowNew);
Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);
Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);
End;
End;


Condition5=True;
If TimeBin<>0 then begin
If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;
If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;
If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False;
End;
If LBOC=False then begin
If Condition5 then begin
For Value1=0 to 2000 begin
PriceKnt[Value1]=0;
End;
TotalKnt=0;
LowBox =Round(Low/Bin4Price,0);
LowValue=LowBox*Bin4Price ;
End;
If Unit4Accum<>5 then HoldBar =CurrentBar;
IPASS=Time;
End;
End;
End;
If LBOC then KeepBar=CurrentBar;
End;

If DateKnt>1 then begin

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

If Smooth=0 then begin
Value17=VAHighNew;
Value18=VALowNew;
End
Else begin
If Condition1 then begin
Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);
Value19=.5/(VABarNew-VABarOld);
End;
Value14=(CurrentBar-VABarNew);
Value16=Value15*Value14*S mooth*(1-Value14*Value19);
Value17=VAHighNew+Value16 ;
Value18=VALowNew +Value16;
End;


{Remove right brace for SIGNAL -- add for INDICATOR}
If LBOC then begin
Value2=-MaxBarsForward;
Value3=-1;
{If KeepBar=0 then OpenOfDay=C;}
If Smooth=0 then begin


End;
End
else begin
Value27=Value17;
Value28=Value18;
Value29=VAPivot;
Value2=0;
Value3=0;
If Unit4Accum=5 then Value3=Value6;
End;



End;
If HandlHi>-1 then begin
Text_SetLocation(HandlHi, Date,Time,Value17);
Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 });
Text_SetLocation(HandlLo, Date,Time,Value18);
End;

End;

End;



If Condition3 and (OnlyLast=False) then begin
HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);
End;

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;



{end date loop}




poc=vapivot;

Share this post


Link to post
Share on other sites

Many syntex errors were fixed except the two things:

 

AddTime( )

TL_SetAll( )

 

vars: PriceBin(.50),
TimeBin(0),
Unit4Accum(0),
TypAccum(0),
BegTime1(0),
BegTime2(0),
BegTime3(0),
DoHoriz(True),
Perc4VA(70),
LineSize(1);
{Begin Comment Out for Signal}

vars:
PointRight(True),{If set false then display will point to left }

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

BegDate(0);{Date on which to start analysis. 0=All }
{this is used to limit the number of analyses that are }
{made and may be necessary -- particularly in TS7/8... }
{to keep "infinite loop" error from occurring. }



{must replace Vars: with in the word INPUT: here for an indicator}

vars:
OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

OnlyHist(false), {Do not make MP for current day until next day. }

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

PlotOpen(True); {Plot open of current analysis -- green dotted line }


Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=UnionSess1StartTime),
LowBox(0), DateKnt(0), HKnt(0),
ATR21(AvgTrueRange(21)),
Bin4Price(Iff(PriceBin>ATR21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),
LowValue(LowBox*Bin4Price ), IPass(0),
Bin4Time(AbsValue(IntPortion(TimeBin))),
ShiftIt((AbsValue(TimeBin )-Bin4Time)*100),
HighValue(H),TotalKnt(0),
HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);
Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)),
TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)),
TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3));
Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);
Vars: VAHighValue(h), VALowValue(l),VAPivot(c),
VAPerc(Iff(Perc4VA>0,Perc4VA/100,.7)),
CurrentMin(TimeToMinutes( time)), EntryP(0);
Vars: VAHighOld(0), VAHighNew(0),
VALowOld(0), VALowNew(0),
VABarOld(0), VABarNew(0),
VADateOld(0), VADateNew(0),
VATimeOld(0), VATimeNew(0),
DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),
HandlHi(-1), HandlLo(-1), HandlCP(-1),
CanBuy(false),CanSell(false),DoInit(True);

{Begin comment out for Indicator
Vars: LossMaxPts(LossMax/BigPointValue),
TakProfPts(TakProf/BigPointValue);
End comment out for Indicator}

Vars: ATR21Val(0), MP(0),
StopHH(0), StopLL(0), EnterBar(0),
MaxCont(0), NCont(0), HoldDate(Date-1);
Vars: PDPtrn(0);


Vars: MaxKnt(15000), Direct(0), DoKnt(0);
Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);


If DoInit then begin
DoInit=False;
Value1=AvgTrueRange(21)/10;
If PriceBin=0 then Bin4Price=Value1
else Bin4Price=PriceBin;

LowBox = Round(L/Bin4Price,0);
End;

LBOC = LastBarOnChart;
If Date<>Date[1] and TimeBin=0 then NewDate=Date;


{For system remove I_}
If MP<>MP[1] then begin
EntryP=O;
EnterBar=CurrentBar;
StopHH=H;
StopLL=L;
End;

If Date>=BegDate then begin



If (TimeBin>0 and Unit4Accum>0) then begin
Condition1=false;
Condition3=false;
If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1;
If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1;
If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;
If Unit4Accum=4 then begin
For Value1 = 0 to 3 begin
Value2=Value1*3+1;
If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;
End;
End;
If Unit4Accum=5 then begin
DoKnt=0;

Value0=AbsValue(IntPortion(Direct));
If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin
Condition1=True;
Condition3=Condition1;
If Direct[1]=0 then begin
HoldBar=CurrentBar-Value0;
HoldAdd=HoldBar-OldHoldBar;
End
Else begin
If LBOC and Sign(Direct)=Sign(Direct[1]) then begin
If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;
HoldBar=CurrentBar;
Value0=0;
End
Else begin
OldHoldBar=HoldBar;
HoldBar=CurrentBar-Value0;
End;

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);
Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
HoldAdd=HoldBar-OldHoldBar;
LowBox =0;
While TotalKnt<8 begin
Bin4Price=Bin4Price/2;
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
LowBox =0;
End;
For Value1 = LowBox to TotalKnt begin
Value3=Value1 * Bin4Price + LowValue;
PriceKnt[Value1]=0;
For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin
If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
End;
End;
End;
End;
If DoKnt>=TimeBin then begin
Condition1=True;
Condition3=Condition1;
DoKnt=0;
End;
End
Else begin
Condition1=false;
Condition3=false;
If TimeBin>0 then begin
If TimeBeg1=0
then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstBarTime)
else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1);
If CurrentMin<0 then CurrentMin=CurrentMin+TimeToMinutes(2359)+1;
If CurrentMin<0 then CurrentMin=CurrentMin+24* 60;
Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin);
Condition3=Condition1;
End
Else begin
If TimeBin<0 then begin
If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4Time);
Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;
Condition3=Condition1;
End
Else begin
If DataCompression>1 then begin
If ShiftIt>13 then ShiftIt=0;
Condition1=Mod(CurrentBar-ShiftIt,13)=0;
Condition3=Condition1;
End
Else Begin
Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);
If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;
If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;
If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;
If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>={Addtime(}Sess1EndTime{,-5))}) then Condition1=True;
Condition3=Condition1;
End;
End;
End;
End;
If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

If Condition1 then begin

If Condition1 or CurrentBar=1 then begin
CanBuy=True;
CanSell=True;
DateKnt=DateKnt+1;
If LBOC=False or Condition3 then OpenOfDay=Open;
End;

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;

If TotalKnt>1 and DateKnt>1 then begin
MaxValue=-99999;
SumValue=0;
{Find the max value and sum up the price occupancies}
Value99=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If Value4>0 then Value99=Value1;
SumValue=SumValue+Value4;
If Value4>=MaxValue then begin
MaxIndex=Value1;
MaxValue=Value4;
End;
End;
{Find all alike and setup CP at middle}
Value2=0;
For Value1=0 to TotalKnt begin
If PriceKnt[Value1]=MaxValue then Value2=Value2+1;
End;
If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

{Now find the Value Area (70% of total counts)}
VAHigh=MaxIndex;
VALow =MaxIndex;
Value9=PriceKnt[MaxIndex];
Value10=0;
While Value9<=IntPortion(SumValue*VAPerc) begin
Value10=Value10+1;
If MaxIndex-Value10>=0 and Value9<=IntPortion(SumValue*VAPerc) then begin
VALow =MaxIndex-Value10;
Value9=Value9+PriceKnt[VALow];
End;
If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumValue*VAPerc) then begin
VAHigh=MaxIndex+Value10;
Value9=Value9+PriceKnt[VAHigh];
End;
End;

VAHighValue=LowValue+VAHigh *Bin4Price;
VALowValue =LowValue+VALow *Bin4Price;
VAPivot =LowValue+MaxIndex*Bin4Price;
Value1=0;
VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];
VALowOld=VALowNew; VALowNew=VALowValue[Value1];
VADateOld=VADateNew; VADateNew=Date[Value1];
VATimeOld=VATimeNew; VATimeNew=Time[Value1];
VABarOld=VABarNew; VABarNew=CurrentBar;

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt
else PDPtrn=0;
PDPtrn=Round(PDPtrn*4,0);

If DateKnt>2 then begin

Value2=LowValue;
If PointRight then Value6=CurrentBar-HoldBar+HoldAdd
else Value6=HoldAdd;

{Now plot the data and highlight VA}
If DateKnt>3 then begin

If LBOC then begin
for Value1=0 to TotalKnt begin
If Handl[Value1]<>0 then begin
TL_Delete(Handl[Value1]);
Handl[Value1]=0;
End;
End;
End;


HKnt=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;
If Value4>0 and Value5<MaxKnt then begin
If DoHoriz then begin
{Value2=(LowBox+Value1)*B in4Price;}
If PointRight
Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)
Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);
Value7=Blue;
If LBOC then Handl[Value1]=Value5;
If Value1<VALow then value7=red;
If Value1>VAHigh then value7=yellow;
If Value1=MaxIndex then value7=Red;
Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);
End;
If AnotHLCP then begin
If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin
If PointRight then Value30=-Value4 else Value30=0;
If Value1=VALow then begin
If HandlLo>=0 then Text_Delete(HandlLo);
HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlLo,0,2 );
End;
If Value1=VAHigh then begin
If HandlHi>=0 then Text_Delete(HandlHi);
HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlHi,0,2 );
End;
If Value1=MaxIndex then begin
If HandlCP>=0 then Text_Delete(HandlCP);
HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ;
Text_SetStyle(HandlCP,0,2 );
End;
End;
End;
End;
Value2=Value2+Bin4Price;
End;

If DoChan and Value5<4500 then begin
Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADateNew,VATimeNew,VAHighNew);
Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALowNew);
Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);
Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);
End;
End;


Condition5=True;
If TimeBin<>0 then begin
If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;
If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;
If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False;
End;
If LBOC=False then begin
If Condition5 then begin
For Value1=0 to 2000 begin
PriceKnt[Value1]=0;
End;
TotalKnt=0;
LowBox =Round(Low/Bin4Price,0);
LowValue=LowBox*Bin4Price ;
End;
If Unit4Accum<>5 then HoldBar =CurrentBar;
IPASS=Time;
End;
End;
End;
If LBOC then KeepBar=CurrentBar;
End;

If DateKnt>1 then begin

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

If Smooth=0 then begin
Value17=VAHighNew;
Value18=VALowNew;
End
Else begin
If Condition1 then begin
Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);
Value19=.5/(VABarNew-VABarOld);
End;
Value14=(CurrentBar-VABarNew);
Value16=Value15*Value14*S mooth*(1-Value14*Value19);
Value17=VAHighNew+Value16 ;
Value18=VALowNew +Value16;
End;


{Remove right brace for SIGNAL -- add for INDICATOR}
If LBOC then begin
Value2=-MaxBarsForward;
Value3=-1;
{If KeepBar=0 then OpenOfDay=C;}
If Smooth=0 then begin


End;
End
else begin
Value27=Value17;
Value28=Value18;
Value29=VAPivot;
Value2=0;
Value3=0;
If Unit4Accum=5 then Value3=Value6;
End;



End;
If HandlHi>-1 then begin
Text_SetLocation(HandlHi, Date,Time,Value17);
Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 });
Text_SetLocation(HandlLo, Date,Time,Value18);
End;

End;

End;



If Condition3 and (OnlyLast=False) then begin
HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);
End;

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;



{end date loop}




poc=vapivot;

Share this post


Link to post
Share on other sites

Anyone fix the TL_SetAll( ) error?

 

 

 

Many syntex errors were fixed except the two things:

 

AddTime( )

TL_SetAll( )

 

vars: PriceBin(.50),
TimeBin(0),
Unit4Accum(0),
TypAccum(0),
BegTime1(0),
BegTime2(0),
BegTime3(0),
DoHoriz(True),
Perc4VA(70),
LineSize(1);
{Begin Comment Out for Signal}

vars:
PointRight(True),{If set false then display will point to left }

Smooth(00), {Angle adjustment for VA projection--range -2>+2 }

BegDate(0);{Date on which to start analysis. 0=All }
{this is used to limit the number of analyses that are }
{made and may be necessary -- particularly in TS7/8... }
{to keep "infinite loop" error from occurring. }



{must replace Vars: with in the word INPUT: here for an indicator}

vars:
OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also}

AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart }

OnlyHist(false), {Do not make MP for current day until next day. }

DoChan(False), {Draw a channel from VA extremes to next set of extremes }

PlotOpen(True); {Plot open of current analysis -- green dotted line }


Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=UnionSess1StartTime),
LowBox(0), DateKnt(0), HKnt(0),
ATR21(AvgTrueRange(21)),
Bin4Price(Iff(PriceBin>ATR21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))),
LowValue(LowBox*Bin4Price ), IPass(0),
Bin4Time(AbsValue(IntPortion(TimeBin))),
ShiftIt((AbsValue(TimeBin )-Bin4Time)*100),
HighValue(H),TotalKnt(0),
HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0);
Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)),
TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)),
TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3));
Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0);
Vars: VAHighValue(h), VALowValue(l),VAPivot(c),
VAPerc(Iff(Perc4VA>0,Perc4VA/100,.7)),
CurrentMin(TimeToMinutes( time)), EntryP(0);
Vars: VAHighOld(0), VAHighNew(0),
VALowOld(0), VALowNew(0),
VABarOld(0), VABarNew(0),
VADateOld(0), VADateNew(0),
VATimeOld(0), VATimeNew(0),
DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0),
HandlHi(-1), HandlLo(-1), HandlCP(-1),
CanBuy(false),CanSell(false),DoInit(True);

{Begin comment out for Indicator
Vars: LossMaxPts(LossMax/BigPointValue),
TakProfPts(TakProf/BigPointValue);
End comment out for Indicator}

Vars: ATR21Val(0), MP(0),
StopHH(0), StopLL(0), EnterBar(0),
MaxCont(0), NCont(0), HoldDate(Date-1);
Vars: PDPtrn(0);


Vars: MaxKnt(15000), Direct(0), DoKnt(0);
Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0);


If DoInit then begin
DoInit=False;
Value1=AvgTrueRange(21)/10;
If PriceBin=0 then Bin4Price=Value1
else Bin4Price=PriceBin;

LowBox = Round(L/Bin4Price,0);
End;

LBOC = LastBarOnChart;
If Date<>Date[1] and TimeBin=0 then NewDate=Date;


{For system remove I_}
If MP<>MP[1] then begin
EntryP=O;
EnterBar=CurrentBar;
StopHH=H;
StopLL=L;
End;

If Date>=BegDate then begin



If (TimeBin>0 and Unit4Accum>0) then begin
Condition1=false;
Condition3=false;
If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1;
If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1;
If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1;
If Unit4Accum=4 then begin
For Value1 = 0 to 3 begin
Value2=Value1*3+1;
If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1;
End;
End;
If Unit4Accum=5 then begin
DoKnt=0;

Value0=AbsValue(IntPortion(Direct));
If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin
Condition1=True;
Condition3=Condition1;
If Direct[1]=0 then begin
HoldBar=CurrentBar-Value0;
HoldAdd=HoldBar-OldHoldBar;
End
Else begin
If LBOC and Sign(Direct)=Sign(Direct[1]) then begin
If LBOC[1]=FALSE THEN OldHoldBar=HoldBar;
HoldBar=CurrentBar;
Value0=0;
End
Else begin
OldHoldBar=HoldBar;
HoldBar=CurrentBar-Value0;
End;

Value2=Highest(H[Value0],HoldBar-OldHoldBar+1);
Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1);
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
HoldAdd=HoldBar-OldHoldBar;
LowBox =0;
While TotalKnt<8 begin
Bin4Price=Bin4Price/2;
LowBox =Round(Value3/Bin4Price,0);
TotalKnt=Round(Value2/Bin4Price,0)-LowBox;
LowValue=LowBox*Bin4Price ;
LowBox =0;
End;
For Value1 = LowBox to TotalKnt begin
Value3=Value1 * Bin4Price + LowValue;
PriceKnt[Value1]=0;
For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin
If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
End;
End;
End;
End;
If DoKnt>=TimeBin then begin
Condition1=True;
Condition3=Condition1;
DoKnt=0;
End;
End
Else begin
Condition1=false;
Condition3=false;
If TimeBin>0 then begin
If TimeBeg1=0
then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstBarTime)
else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1);
If CurrentMin<0 then CurrentMin=CurrentMin+TimeToMinutes(2359)+1;
If CurrentMin<0 then CurrentMin=CurrentMin+24* 60;
Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin);
Condition3=Condition1;
End
Else begin
If TimeBin<0 then begin
If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4Time);
Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0;
Condition3=Condition1;
End
Else begin
If DataCompression>1 then begin
If ShiftIt>13 then ShiftIt=0;
Condition1=Mod(CurrentBar-ShiftIt,13)=0;
Condition3=Condition1;
End
Else Begin
Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime);
If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True;
If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True;
If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True;
If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>={Addtime(}Sess1EndTime{,-5))}) then Condition1=True;
Condition3=Condition1;
End;
End;
End;
End;
If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True;

If Condition1 then begin

If Condition1 or CurrentBar=1 then begin
CanBuy=True;
CanSell=True;
DateKnt=DateKnt+1;
If LBOC=False or Condition3 then OpenOfDay=Open;
End;

If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;

If TotalKnt>1 and DateKnt>1 then begin
MaxValue=-99999;
SumValue=0;
{Find the max value and sum up the price occupancies}
Value99=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If Value4>0 then Value99=Value1;
SumValue=SumValue+Value4;
If Value4>=MaxValue then begin
MaxIndex=Value1;
MaxValue=Value4;
End;
End;
{Find all alike and setup CP at middle}
Value2=0;
For Value1=0 to TotalKnt begin
If PriceKnt[Value1]=MaxValue then Value2=Value2+1;
End;
If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2);

{Now find the Value Area (70% of total counts)}
VAHigh=MaxIndex;
VALow =MaxIndex;
Value9=PriceKnt[MaxIndex];
Value10=0;
While Value9<=IntPortion(SumValue*VAPerc) begin
Value10=Value10+1;
If MaxIndex-Value10>=0 and Value9<=IntPortion(SumValue*VAPerc) then begin
VALow =MaxIndex-Value10;
Value9=Value9+PriceKnt[VALow];
End;
If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumValue*VAPerc) then begin
VAHigh=MaxIndex+Value10;
Value9=Value9+PriceKnt[VAHigh];
End;
End;

VAHighValue=LowValue+VAHigh *Bin4Price;
VALowValue =LowValue+VALow *Bin4Price;
VAPivot =LowValue+MaxIndex*Bin4Price;
Value1=0;
VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1];
VALowOld=VALowNew; VALowNew=VALowValue[Value1];
VADateOld=VADateNew; VADateNew=Date[Value1];
VATimeOld=VATimeNew; VATimeNew=Time[Value1];
VABarOld=VABarNew; VABarNew=CurrentBar;

If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt
else PDPtrn=0;
PDPtrn=Round(PDPtrn*4,0);

If DateKnt>2 then begin

Value2=LowValue;
If PointRight then Value6=CurrentBar-HoldBar+HoldAdd
else Value6=HoldAdd;

{Now plot the data and highlight VA}
If DateKnt>3 then begin

If LBOC then begin
for Value1=0 to TotalKnt begin
If Handl[Value1]<>0 then begin
TL_Delete(Handl[Value1]);
Handl[Value1]=0;
End;
End;
End;


HKnt=0;
For Value1=0 to TotalKnt begin
Value4=PriceKnt[Value1];
If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6;
If Value4>0 and Value5<MaxKnt then begin
If DoHoriz then begin
{Value2=(LowBox+Value1)*B in4Price;}
If PointRight
Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2)
Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2);
Value7=Blue;
If LBOC then Handl[Value1]=Value5;
If Value1<VALow then value7=red;
If Value1>VAHigh then value7=yellow;
If Value1=MaxIndex then value7=Red;
Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false);
End;
If AnotHLCP then begin
If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin
If PointRight then Value30=-Value4 else Value30=0;
If Value1=VALow then begin
If HandlLo>=0 then Text_Delete(HandlLo);
HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlLo,0,2 );
End;
If Value1=VAHigh then begin
If HandlHi>=0 then Text_Delete(HandlHi);
HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 ));
Text_SetStyle(HandlHi,0,2 );
End;
If Value1=MaxIndex then begin
If HandlCP>=0 then Text_Delete(HandlCP);
HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ;
Text_SetStyle(HandlCP,0,2 );
End;
End;
End;
End;
Value2=Value2+Bin4Price;
End;

If DoChan and Value5<4500 then begin
Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADateNew,VATimeNew,VAHighNew);
Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALowNew);
Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false);
Value7=TL_SetAll(Value4, red , LineSize, 3, False, false);
End;
End;


Condition5=True;
If TimeBin<>0 then begin
If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False;
If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False;
If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False;
End;
If LBOC=False then begin
If Condition5 then begin
For Value1=0 to 2000 begin
PriceKnt[Value1]=0;
End;
TotalKnt=0;
LowBox =Round(Low/Bin4Price,0);
LowValue=LowBox*Bin4Price ;
End;
If Unit4Accum<>5 then HoldBar =CurrentBar;
IPASS=Time;
End;
End;
End;
If LBOC then KeepBar=CurrentBar;
End;

If DateKnt>1 then begin

If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin

If Smooth=0 then begin
Value17=VAHighNew;
Value18=VALowNew;
End
Else begin
If Condition1 then begin
Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld);
Value19=.5/(VABarNew-VABarOld);
End;
Value14=(CurrentBar-VABarNew);
Value16=Value15*Value14*S mooth*(1-Value14*Value19);
Value17=VAHighNew+Value16 ;
Value18=VALowNew +Value16;
End;


{Remove right brace for SIGNAL -- add for INDICATOR}
If LBOC then begin
Value2=-MaxBarsForward;
Value3=-1;
{If KeepBar=0 then OpenOfDay=C;}
If Smooth=0 then begin


End;
End
else begin
Value27=Value17;
Value28=Value18;
Value29=VAPivot;
Value2=0;
Value3=0;
If Unit4Accum=5 then Value3=Value6;
End;



End;
If HandlHi>-1 then begin
Text_SetLocation(HandlHi, Date,Time,Value17);
Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 });
Text_SetLocation(HandlLo, Date,Time,Value18);
End;

End;

End;



If Condition3 and (OnlyLast=False) then begin
HandlHi=(-1); HandlLo=(-1); HandlCP=(-1);
End;

If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin
Value3=Round(Low/Bin4Price,0);
If Value3<LowBox and Value3<>0 then begin
Value2=LowBox-Value3;
For Value1= 2000-Value2 downto 0 begin
PriceKnt[Value1+Value2]=PriceKnt[Value1];
PriceKnt[Value1]=0;
End;
LowBox =Value3;
LowValue=LowBox*Bin4Price ;
TotalKnt=TotalKnt+Value2;
End;
Value2=Round(Low/Bin4Price,0) -LowBox;
Value3=Round(High/Bin4Price,0) -LowBox;
For Value1=Value2 to Value3 begin
PriceKnt[Value1]=PriceKnt[Value1]+1;
End;
If Value3>TotalKnt then TotalKnt=Value3;
End;



{end date loop}




poc=vapivot;

Share this post


Link to post
Share on other sites
{Function: TL_SetAll 

Purpose: Reduce the clutter in TL programming with one call to 
set color, size, style, left and right extension. 

These almost always need to be specified and clutter up 
the programs something awful. This should help. 

Author: Clyde Lee, Copyright SYTECH Corporation, 2002 
www.theswingmachine.com 

Use: Permission granted to use the function in any application 
desired so long as the copyright notice is retained. 

} 


Inputs: TL_Ref(numericsimple), 
Colr(numericsimple), 
Size(numericsimple), 
Styl(numericsimple), 
TLxl(truefalse), 
TLXr(truefalse); 



TL_SetColor(TL_Ref, Colr); 
TL_SetSize (TL_Ref, Size); 
TL_SetStyle(TL_Ref, Styl); 
TL_SetExtLeft (TL_Ref, TLxl); 
TL_SetExtRight(TL_Ref, TLxr); 

TL_SetAll=1; 

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

    • Date : 25th November 2021. Market Update – November 25 – Solid US data lifts USD, Stocks, & Yields. USD (USDIndex 96.70) holds on at 16-mth highs; Strong set of US data yesterday GDP (2.1%) up a tick but missed by a tick, Claims (199k) at 52-yr low, PCE (0.4% m/m & 4.1% y/y), in-line & largest since Jan.1991, along with a big beat (5.9%) for GDP Price index, Durable Goods (0.5%) in-line, Personal Spending (1.3%) a big beat, Personal Income (0.5%) a beat, Trade balance a big beat (14.6%) on strong Exports, Inventories (-2.2%) a big miss, but shows demand is strong. Consumer Sentiment a beat and New Home Sales flat (745K) and missed. Stocks & Yields pushed higher, Oil held onto gains and Gold tested 3-week lows.   The FOMC Minutes showed (1) there could be a faster taper than the $15bn/mth currently planned, (2) Inflation could indeed be “persistent” (3) Clear division over 2022/23 rate hike cycle, Doves hold sway for now. US Yields 10yr trades at 1.644%, down from yesterday’s 1.694% high. Equities – Gains into the Holiday USA500 +10.76 (0.23%) at 4701 – USA500.F trades higher at 4713. USOil – peaked at $78.53 Inventories +1.0 vs -1.7 weakened prices – now at $77.65 Gold found a floor at 1782, but struggles to recoup $1800 at $1790. FX markets – EURUSD now 1.1216, having broken 1.1200, USDJPY now 115.36, from 115.50 & Cable back to 1.3350 from 1.3315 yesterday. Overnight – JPY PPI (1.0%) hit a 10-yr high, German GDP and consumer confidence both missed (1.7% vs 1.8% and -1.6% vs -1.0%) respectively. European Open – December 10-yr Bund future up 16 ticks, while US futures are slightly in the red. Bunds already outperformed yesterday, as EZ spreads widened in the wake of hawkish leaning ECB comments & confirmation that German finance ministry will go to the liberal FDP, which likely means more resistance to debt mutualisation across the EZ & more pressure on ECB to limit asset purchases. DAX & FTSE 100 futures are currently up 0.4% & 0.3% respectively & US futures are posting gains of 0.3-0.4%, suggesting markets are coping quite well with the prospect of less accommodative policies. Indeed, it seems to an extent that they welcome the CB’s acknowledgement that inflation risks could be less temporary than previously thought. Today – ECB Minutes, ECB’s Elderson, Schnabel, Lagarde and BOE’s Bailey Biggest FX Mover @ (07:30 GMT) CADJPY (0.20%) The rally from Tuesday’s low under 90.00 has been sustained with 91.25 being tested earlier today. MAs aligned higher, MACD signal line & histogram rising & over 0 line, RSI 61, H1 ATR 0.077, Daily ATR 0.707. Always trade with strict risk management. Your capital is the single most important aspect of your trading business. Please note that times displayed based on local time zone and are from time of writing this report. Click HERE to access the full HotForex Economic calendar. Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • Date : 24th November 2021. Market Update – November 24 – USD & Yields Higher, Stocks Mixed, Oil Recovers. Trading Leveraged Products is risky USD (USDIndex 96.50) holds on at highs; EM currencies under particular pressure. (TRY lost 15% after Erdogan refused a rate rise). RBNZ raised rates but NZD fell (like the last time they raised rates!) JPY Inflation 2 ticks better than expected. USDJPY at January 2017 levels around 115.00. PMI data better across the globe, Stocks mixed in US & Asia, Yields bid, Oil recovered significantly and Gold pressured by yields. Biden invites Taiwan to its “Summit for Democracy”, WHO talks of additional 700k Covid deaths across Europe (Slovakia latest to talk lockdowns). US Yields 10yr trades at 1.667%, down from yesterday’s 1.684% high. Equities Mixed. Musk sold more stock, Banks & Oil majors lead. USA500 +7.76 (0.17%) at 4690 – USA500.F trades lower at 4684. USOil – rallied over 3% to $78.20 highs despite global strategic reserves being sold to cool prices. Gold found a floor at 1782, but struggles to recoup $1800 at $1790. FX markets – EURUSD down to 1.1245, USDJPY over 115.23, earlier now at 114.88 & Cable back to 1.3375. European Open – December 10-yr Bund future up 26 ticks, US futures also broadly higher. RBNZ delivered expected rate hike & markets seem to be scaling back fears of escalating inflation as even dovish leaning BoE & ECB members highlight risk of second round effects. ECB VP Guindos highlighted overnight that the drivers of inflation are becoming more structural, which adds to signals that the CB is finally ready to start reining in stimulus. DAX & FTSE 100 futures currently up 0.3% & 0.2% respectively. Today – Big data day ahead of Thanksgiving Weekend. – German Ifo, US Weekly Claims GDP, PCE, Durables, FOMC Mins. & ECB speak Biggest FX Mover @ (07:30 GMT) NZDJPY (-0.77%) RBNZ in-line but Dovish, sank from breach of 80.00 yesterday to 79.24, and 79.40 now. Faster MAs aligned lower, MACD signal line & histogram falling & below 0 line, RSI 35 & weak, Stochs OS. H1 ATR 0.17, Daily ATR 0.70. Please note that times displayed based on local time zone and are from time of writing this report. Click HERE to access the full HotForex Economic calendar. Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding on how markets work. Click HERE to register for FREE! Click HERE to READ more Market news. Stuart Cowell Head Market Analyst HotForex Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • EURUSD HOVERS NEAR MULTI-MONTH LOW, UNDER 1.1250 LEVEL   EURUSD Price Analysis – November 24 Throughout the session, the EURUSD pair remained on the losing side and was last seen moving with considerable losses around the 1.1250-36 level. The announcement that the White House has opted to reappoint incumbent Fed Chair Jerome Powell for a second term sparked the recent strong dip. The spot is trading at 1.1253 at the time of writing, down 0.25 percent on the day. Key Levels Resistance Levels: 1.1525, 1.1422, 1.1300 Support Levels: 1.1200, 1. 1150, 1.1100 EURUSD Long term Trend: Bearish EURUSD has sunk to fresh multi-day lows, as seen on the daily chart, after extending the recent breach beneath the moving averages 5 around the 1.1300 level. This exposes the possibility of a deeper pullback and a re-test of the psychological support around 1.1200. Under the 1.1200 level, the euro’s underlying bullish attitude is in jeopardy. Overall, the EURUSD stays bearish while trading under the major horizontal support turned resistance and significant level at 1.1422. A breakout of the 1.1300 level, on the other hand, would aim for the 1.1350 level on the way to the 1.1400 zones. The fall of the 1.1200 zones, in the alternative scenario, is viewed as a bearish continuation indicator. EURUSD Short term Trend: Bearish The risk is weighted to the negative on the 4-hour chart, as the pair is developing below the firmly bearish 5 and 13 moving averages. Technical indicators have shifted to the downside, with negative levels. However, in the present scenario, the RSI has not yet reached oversold territory, allowing for more selling. On the upside, a break over the modest resistance level of 1.1300 might shift the intraday bias to neutral. On the downside, the 1.1200 zones provide initial support. The next important level of support is around the 1.1150 mark. If there are any more losses, the 1.1100 extension level of the low decline may be tested. Source: https://learn2.trade 
    • IS IT RATIONAL TO SETTLE FOR 10% RETURNS PER MONTH? “One of the secrets few know and fewer implement when it comes to trading success is that you have to really care about doing well. These days, I see a lot of traders not caring enough, not prioritizing learning about trading, and making pathetic weak-willed excuses.” – Chris T. Perfectionism – a bane of the trading world When people look for a solution to their trading problems, they tend to look for the solution in the wrong places, having the wrong mindset. One problem with most traders is perfectionism. For instance, we tend to go to those who promise us 50% to 100% per week or month. If someone gives an estimate of 5% profits per month, we would think that is too small. If an investment salesperson promises huge returns in a short period of time, we’re drawn to them. What if I tell you that 5% per month is good returns on your trading or investment, would you agree with me? Is 60% growth per annum not good enough? Many years ago, one of my mentors in the financial industry told me that, even 20% growth per annum is good. In schools, we tend to ridicule those who make average grades and praise those who make excellent grades. The same is true of the world of sports. Do you think great sports teams win all their matches always? No! But they do well over time. Are 10% gains per month too low? Now let me ask these questions: How much percentage do you earn on your savings account per annum? How much do you earn on your fixed deposit account per month? How many people can pay off their mortgages within one year? If you buy a bus, to use for commercial purposes, is it easy for you to recover your money in one year? Can you buy a property and sell it for 100% profit within 10 months? If you found a startup, how long do you think it would take you to start making profits? Please attempt to answer these questions yourself, based on real-life experiences. Now, back to the question that makes the last subheading: Are 10% gains per month too low? Why do we tend to be unrealistic and fallacious when it comes to online trading? Making 10% returns per month from Learn2.trade crypto signals One good thing about the margin trading of cryptos is that you can make money, both in bull and bear markets. You don’t make money only when the price is going up. If your timing and methodology are right, you can predict a downward movement or an upward movement and participate in them. Learn2.trade provides quality crypto signals to interested traders. Each signal comes with stop loss and take profit targets. Sometimes a trade is closed before the stop or the target is hit. We use 5 types of orders for the crypto signals. They are Instant Execution, also known as Market Execution, Buy Limit, Sell Limit, Buy Stop, and Sell Stop. Generating an average of 2 – 3 signals per day, we also use risk settings that are usually around 1% per trade and we attempt to gain more than we risk. As these signals are sent, we ensure that we also use them, practicing what we preach. Learn2.trade crypto signals – recent performances Please check the image below to peruse what has been made recently. You see can that we use stop loss, and use small lot sizes, relative to the size of the accounts. It just doesn’t make sense to bet too big on an individual trade. You can also see that we have both losses and profits. However, our average profits are bigger than average losses. That is the pedigree of a viable/ promising strategy: Make more money than you lose. Therefore, losses and drawdowns are also tightly controlled so that they don’t have significant effects on the account. These kinds of drawdowns are shallow, for recovery and eventual growth always happen. The markets are difficult but profitable Making consistent, regular profits from the market is hard, but success is possible. When the markets prove difficult, then we only need creative approaches. Markets will continue to prove uneasy and tough, but we will continue to make profits from them, no matter what. We target 10% profits per month, though we make more than this in most cases. 100% profits every 10 months is an enviable achievement. If 10% gains per month are compounded, the results in a few to several years will be amazing. Yes, you should be aware of the power of compounding. Join us today, in this journey of regular, monthly profits. Please see the image above, to know relevant metrics and figures of the recent results of the strategy behind the signals. You can join us here for, few free crypto signals per week: For Cryptos. Or you can hop in, and become our VIP right away, and enjoy all our crypto signals, up to 3 signals per day. Get access to the ability to make 10% or more per month. You can monitor our crypto signals trading performances here: L2T Crypto Signals on MyFxbook   Source: https://learn2.trade   
    • Yes trading currencies is much more risky than trading stocks, since they're not supported by central bank policy efforts but instead freely fluctuation in a very random fashion. Profits can create wrong impression that you learned how to trade but often it is just the product of pure luck. 
×
×
  • Create New...

Important Information

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