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.
programmer
Members-
Content Count
36 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Articles
Everything posted by programmer
-
Backtesting can be misleading: For backtesting: Avoid MT4. Avoid Ninja. Avoid Neoticker Avoid Amibroker Avoid MC . TS - Is fine, if you know what you are doing.
-
Yes Blowfish, tnx. Just observe the Dax when the depth is weak, you will see that the surges appear quite near that time. Its massive dumping of orders in search for a zero sum game partner, hence the strange price spikes. Imagine a whirlpool of orders if you may... If one would want to avoid these, just wait for the depth to get some bulk (I have coded an alert into my depth (my own platform) to warn me when such an occurance i.e. blank depth [is current] to avoid trading the dax at that time. The Fesx will rarely show this, since its volume is massive compared to the Dax. Actually if you have a very good signal ,I would trade the Fesx with some more juice to compensate for the shorter move.
-
I use use my own coded direct to API platform . No I have never used Futuresbetting.com, I use IB since I also manage a "small" fund and IB are to be trusted with this !
-
Correct. Yes I have coded it as well, I used my own coded platform with Zenfire feed and IQ FEED and some direct API action... There is a way to distinguish the tree from the forest....Just concentrate on market structure and you will get it ....If you get my meaning you will add a very small math filter...
-
It would be nice to reply to a thread more politely... SO...X.... is not very nice.... As for your q: The answer lies mainly in volume. The spikes are massive orders coming into the market. The cause is the Market structure: The orders must "meet partners" in a zero sum game.... If you want to understand this fully read how the exchnage is built, and mainly the rounds of orders circulated. This information is freely available on any exchange. In essence market makers bomb the market in rounds of 5 mins, to round hour. The bigger the volume, the less likely it is a market order. TRO's idea to straddle the 1hr open range expansion is a nice idea to try to bank on this idea, however, market makers know this now, hence the unusual spikes at unexplained intervals out of the order. Hence, why the more small retail player play games like "tro's" 1ST HR RANGE EXPANSION, THE MORE It HURTS THE MARKETS... PS - No offence to TRO, or his ways, or his donational indicators... Hope you understand now :>
-
I just read through this thread. As an experienced programmer and trader, I would suggest that all wannabe Dax traders avoid this market until they have at least 1 year of demo trading it! I am not kidding, this market is unique and crazy. There recently have been some spikes on dax that could set you back 30-50 points in a couple of seconds . These spikes can be explained logically, however, day traders can get their accounts wiped out very quickly if using leverage on this contract. It seems that the more retail traders play these markets, the more these markets become unstable and dangerous. I would avoid Infinity or any other brokers that is not located directly in Europe, in lieu of delay from server to server US/EU can cause very bad fills. Also, do not trade this market if the depth is weak, I would wait for 50 plus on both sides of the depth to even start looking at a possible trade. As for auto trading and systems programming for the dax. Well I coded it all for the dax and would say that absent a true manual edge and Volume analysis nothing will work consistantly, and even if something will , recent spikes in price suggest that a nominal ratio of 1 lot to 15k is the max you should risk on that contract. To sum up, do not trade this contract if you don't know what you are doing and absent at least a year of demo trading! You really have to be a pro to cash on this one !
-
Hi Snowbird, Bryce looks to the 3 day balance point as a mid level for market sentiment. So, put it on SPY and DJIA to get a feel where the market is possibly going. As for my own usage, I look for confluence on versatile points thus, when we had a volumetric day - in my experience it will serve as possible s/r levels for several days up to 10 since big players are positioned there, hence why I use 10 days on off. No need to use Wavetrader its mostly predictive software, which is not the way to go....However, looking at the s/r levels in conjunction with other confluenctial points is quite high probability trading.
-
Hi guys , As requested by James I am posting my code here. Having read Bryce Gylmores Ideas I coded it but with some better points... This is for MC or TS. I also attach an image from this minute , how I trade the ES along with this and my other systems (Please take caution when using this, this is not a trading system, only powerful s/r). Hope you guys enjoy this. And James tnx for the Great forum ! balance-point.txt.txt
-
Ji James, I have tried yet again and I get a loop of the warning again and again????? Please do it for me, under my alias if you wish.
-
James, I have tried to post it there but I get a repeated warning and no option to post a new thread. You have some bug in website, or I dont have enough security to post in the indicators section???
-
You are welcome guys. Sorry for pasting the code into the thread. Moderator please fix this. PS - As you can see I actually enhanced the code, because Gylmore's idea is only for a 3 day balance point which is less than sufficient....So I added some points. As with reversals take caution and use reversal approaches, to elliminate false moves. I would seek confluence of major pivots with this .
-
Hi Guys, Code for TS/MC. Trading purpose : Very strong sup/res analysis. New here so I wanted to contribute some of my coding and ideas. Having read Bryce Gylmore journals, I coded his Balance point idea. This is my personal coding so no copyright issues will come up. Hope this helps. The code: ------------------------------------------------------------------ inputs: middle3dTLColor(Yellow), Use2Day(true),middle2dTLColor(Red), UseYesterdayHL(true), middleYesterdayTLColor(Blue), Use4Day(true),middle4dTLColor(Magenta), Use5Day(true),middle5dTLColor(Cyan), Use10Day(true),middle10dTLColor(Green) ; Vars:numOfDays(0), isGlobex(false), SessionNum(0), High3D(0), Low3D(0), middle3D(0), prev3DHighTrendLine(0), prev3DHighText(0), prev3DLowTrendLine(0), prev3DLowText(0), middle3DTL(0), middle3DText(0), numOfPrevDays(4), High2D(0), Low2D(0), middle2D(0), prev2DHighTrendLine(-1), prev2DHighText(-1), prev2DLowTrendLine(-1), prev2DLowText(-1), middle2DTL(-1), middle2DText(-1), numOfPrev2Days(3), High1D(0), Low1D(0), middle1D(0), prev1DHighTrendLine(-1), prev1DHighText(-1), prev1DLowTrendLine(-1), prev1DLowText(-1), middle1DTL(-1), middle1DText(-1), numOfPrev1Days(2), High4D(0), Low4D(0), middle4D(0), prev4DHighTrendLine(-1), prev4DHighText(-1), prev4DLowTrendLine(-1), prev4DLowText(-1), middle4DTL(-1), middle4DText(-1), numOfPrev4Days(5), High5D(0), Low5D(0), middle5D(0), prev5DHighTrendLine(-1), prev5DHighText(-1), prev5DLowTrendLine(-1), prev5DLowText(-1), middle5DTL(-1), middle5DText(-1), numOfPrev5Days(6), High10D(0), Low10D(0), middle10D(0), prev10DHighTrendLine(-1), prev10DHighText(-1), prev10DLowTrendLine(-1), prev10DLowText(-1), middle10DTL(-1), middle10DText(-1), numOfPrev10Days(11), HighTrendLine(-1), HighText(-1), LowTrendLine(-1), LowText(-1),tempdaysback(0) ; if lastbaronchart then begin if (DayOfWeek(date) <6 and DayOfWeek(date)<>0) then SessionNum = DayOfWeek(date) else SessionNum = 1; isGlobex = InStr(symbolname,".D") > 0; if (bartype <> 2) then begin if (isGlobex=false) then begin if ( SessionEndTime(1,SessionNum) = time and dayofweek(date) = 5) then numOfDays = 1 else if (dayofweek(date) = 4 or dayofweek(date) = 5 or dayofweek(date) = 3 or dayofweek(date) = 2) then numOfDays = 2 else if (dayofweek(date) = 1) then numOfDays = 4 else if (dayofweek(date) = 6) then numOfDays = 0 else if (dayofweek(date) = 0) then numOfDays = 5; end else begin if ( SessionEndTime(1,SessionNum) = time) then begin if (dayofweek(date) = 1) then numOfDays = 3 else if (dayofweek(date) = 5) then numOfDays = 0 else numOfDays = 1; end else begin if ( dayofweek(date) = 4 or dayofweek(date) = 5 or dayofweek(date) = 3 or dayofweek(date) = 2) then numOfDays = 1 else if (dayofweek(date) = 1) then numOfDays = 3 else if (dayofweek(date) = 0 ) then numOfDays = 4 else if (dayofweek(date) = 6) then numOfDays =2; end; end; end; //3Days High3D = MaxList(HighD(1), HighD(2), HighD(3)); Low3D = MinList(LowD(1), LowD(2), LowD(3)); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High3D = MaxList(HighD(0), HighD(1), HighD(2)); Low3D = MinList(LowD(0), LowD(1), LowD(2)); end else if((DayOfWeek(currentDate) = 1 or DayOfWeek(currentDate) = 2 or DayOfWeek(currentDate) = 3 ) and (bartype<>2 and isGlobex=false)) then begin High3D = MaxList(HighD(1),HighD(2), HighD(3), HighD(4)); Low3D = MinList(LowD(1),LowD(2), LowD(3), LowD(4)); end; middle3D = Low3D+(High3D-Low3D)/2; tempdaysback = numOfDays+2; if (dayofweek(date) = 3 or dayofweek(date) = 2) then begin if (isGlobex=false) then tempdaysback = 6 else tempdaysback = 5; end; if (prev3DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev3DHighTrendLine,JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum), High3D) else TL_SetBegin(prev3DHighTrendLine,JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), High3D); TL_SetEnd(prev3DHighTrendLine, Date, Time+2, High3D); end else begin if (bartype = 2) then prev3DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum) , High3D, DATE, time+2 , High3D) else prev3DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , High3D, DATE, time+2 , High3D); TL_SetColor(prev3DHighTrendLine, middle3dTLColor); TL_SetStyle(prev3DHighTrendLine, 4); end; if (prev3DHighText > 0) then Text_SetLocation (prev3DHighText, date, time+2 ,High3D) else begin prev3DHighText = Text_New(DATE, TIME+2 , High3D, " 3 Day High ("+numtostr(High3D,4)+")"); Text_SetStyle (prev3DHighText, 0, 2); TEXT_SETCOLOR(prev3DHighText, middle3dTLColor); end; if (prev3DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev3DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum), Low3D) else TL_SetBegin(prev3DLowTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), Low3D); TL_SetEnd(prev3DLowTrendLine, Date, Time+2, Low3D); end else begin if (bartype = 2) then prev3DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum) , Low3D, DATE, time+2, Low3D) else prev3DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , Low3D, DATE, time+2, Low3D); TL_SetColor(prev3DLowTrendLine, middle3dTLColor); TL_SetStyle(prev3DLowTrendLine, 4); end; if (prev3DLowText > 0) then Text_SetLocation (prev3DLowText, date, time+2 ,Low3D) else begin prev3DLowText = Text_New(DATE, TIME+2 , Low3D, " 3 Day Low ("+numtostr(Low3D,4)+")"); Text_SetStyle (prev3DLowText, 0, 2); TEXT_SETCOLOR(prev3DLowText, middle3dTLColor); end; if (middle3DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle3DTL, JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum), middle3D) else TL_SetBegin(middle3DTL, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), middle3D); TL_SetEnd(middle3DTL, Date, Time+2, middle3D); end else begin if (bartype = 2) then middle3DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrevDays])), SessionStartTime(1,SessionNum) , middle3D, DATE, time+2, middle3D) else middle3DTL= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , middle3D, DATE, time+2, middle3D); TL_SETSIZE(middle3DTL, 2); TL_SetColor(middle3DTL, middle3dTLColor); end; if (middle3DText > 0) then Text_SetLocation (middle3DText, date, time+2 ,middle3D) else begin middle3DText = Text_New(DATE, TIME+2 , middle3D, " 3 Day BPOINT ("+numtostr(middle3D,4)+")"); Text_SetStyle (middle3DText, 0, 2); TEXT_SETCOLOR(middle3DText, middle3dTLColor); end; //2 days if (Use2Day) then begin High2D = MaxList(HighD(1), HighD(2)); Low2D = MinList(LowD(1), LowD(2)); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High2D = MaxList(HighD(0), HighD(1)); Low2D = MinList(LowD(0), LowD(1)); end else if((DayOfWeek(currentDate) = 1 or DayOfWeek(currentDate) = 2) and (bartype<>2 and isGlobex=false)) then begin High2D = MaxList(HighD(1),HighD(2), HighD(3)); Low2D = MinList(LowD(1),LowD(2), LowD(3)); end; middle2D = Low2D+(High2D-Low2D)/2; tempdaysback = numOfDays+1; if (dayofweek(date) = 2) then begin if (isGlobex=false) then tempdaysback = 5 else tempdaysback = 4; end; if (prev2DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev2DHighTrendLine, JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1,SessionNum), High2D) else TL_SetBegin(prev2DHighTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), High2D); TL_SetEnd(prev2DHighTrendLine, Date, Time+2, High2D); end else begin if (bartype = 2) then prev2DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1,SessionNum) , High2D, DATE, time+2 , High2D) else prev2DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , High2D, DATE, time+2 , High2D); TL_SetColor(prev2DHighTrendLine, middle2dTLColor); TL_SetStyle(prev2DHighTrendLine, 4); end; if (prev2DHighText > 0) then Text_SetLocation (prev2DHighText, date, time+2 ,High2D) else begin prev2DHighText = Text_New(DATE, TIME+2 , High2D, " 2 Day High ("+numtostr(High2D,4)+")"); Text_SetStyle (prev2DHighText, 0, 0); TEXT_SETCOLOR(prev2DHighText, middle2dTLColor); end; if (prev2DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev2DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1,SessionNum), Low2D) else TL_SetBegin(prev2DLowTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), Low2D); TL_SetEnd(prev2DLowTrendLine, Date, Time+2, Low2D); end else begin if (bartype = 2) then prev2DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1, SessionNum) , Low2D, DATE, time+2, Low2D) else prev2DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1, SessionNum) , Low2D, DATE, time+2, Low2D); TL_SetColor(prev2DLowTrendLine, middle2dTLColor); TL_SetStyle(prev2DLowTrendLine, 4); end; if (prev2DLowText > 0) then Text_SetLocation (prev2DLowText, date, time+2 ,Low2D) else begin prev2DLowText = Text_New(DATE, TIME+2 , Low2D, " 2 Day Low ("+numtostr(Low2D,4)+")"); Text_SetStyle (prev2DLowText, 0, 0); TEXT_SETCOLOR(prev2DLowText, middle2dTLColor); end; if (middle2DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle2DTL, JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1,SessionNum), middle2D) else TL_SetBegin(middle2DTL, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), middle2D); TL_SetEnd(middle2DTL, Date, Time+2, middle2D); end else begin if (bartype = 2) then middle2DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev2Days])), SessionStartTime(1,SessionNum) , middle2D, DATE, time+2, middle2D) else middle2DTL= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , middle2D, DATE, time+2, middle2D); TL_SETSIZE(middle2DTL, 2); TL_SetColor(middle2DTL, middle2dTLColor); end; if (middle2DText > 0) then Text_SetLocation (middle2DText, date, time+2 ,middle2D) else begin middle2DText = Text_New(DATE, TIME+2 , middle2D, " 2 Day BPOINT ("+numtostr(middle2D,4)+")"); Text_SetStyle (middle2DText, 0, 0); TEXT_SETCOLOR(middle2DText, middle2dTLColor); end; end; if (UseYesterdayHL) then begin High1D = HighD(1); Low1D = LowD(1); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High1D =HighD(0); Low1D = LowD(0); end else if(DayOfWeek(currentDate) = 1 and (bartype<>2 and isGlobex=false)) then begin High1D = MaxList(HighD(1), HighD(2)); Low1D = MinList(LowD(1), LowD(2)); end; middle1D = Low1D+(High1D-Low1D)/2; if (prev1DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev1DHighTrendLine, JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1,SessionNum), High1D) else TL_SetBegin(prev1DHighTrendLine, JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1,SessionNum), High1D); TL_SetEnd(prev1DHighTrendLine, Date, Time+2, High1D); end else begin if (bartype = 2) then prev1DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1,SessionNum) , High1D, DATE, time+2 , High1D) else prev1DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1,SessionNum) , High1D, DATE, time+2 , High1D); TL_SetColor(prev1DHighTrendLine, middleYesterdayTLColor); TL_SetStyle(prev1DHighTrendLine, 4); end; if (prev1DHighText > 0) then Text_SetLocation (prev1DHighText, date, time+2 ,High1D) else begin prev1DHighText = Text_New(DATE, TIME+2 , High1D, " 1 Day High ("+numtostr(High1D,4)+")"); Text_SetStyle (prev1DHighText, 0, 1); TEXT_SETCOLOR(prev1DHighText, middleYesterdayTLColor); end; if (prev1DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev1DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1,SessionNum), Low1D) else TL_SetBegin(prev1DLowTrendLine, JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1,SessionNum), Low1D); TL_SetEnd(prev1DLowTrendLine, Date, Time+2, Low1D); end else begin if (bartype = 2) then prev1DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1, SessionNum) , Low1D, DATE, time+2, Low1D) else prev1DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1, SessionNum) , Low1D, DATE, time+2, Low1D); TL_SetColor(prev1DLowTrendLine, middleYesterdayTLColor); TL_SetStyle(prev1DLowTrendLine, 4); end; if (prev1DLowText > 0) then Text_SetLocation (prev1DLowText, date, time+2 ,Low1D) else begin prev1DLowText = Text_New(DATE, TIME+2 , Low1D, " 1 Day Low ("+numtostr(Low1D,4)+")"); Text_SetStyle (prev1DLowText, 0, 1); TEXT_SETCOLOR(prev1DLowText, middleYesterdayTLColor); end; if (middle1DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle1DTL, JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1,SessionNum), middle1D) else TL_SetBegin(middle1DTL, JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1,SessionNum), middle1D); TL_SetEnd(middle1DTL, Date, Time+2, middle1D); end else begin if (bartype = 2) then middle1DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev1Days])), SessionStartTime(1,SessionNum) , middle1D, DATE, time+2, middle1D) else middle1DTL= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays), SessionStartTime(1,SessionNum) , middle1D, DATE, time+2, middle1D); TL_SETSIZE(middle1DTL, 2); TL_SetColor(middle1DTL, middleYesterdayTLColor); end; if (middle1DText > 0) then Text_SetLocation (middle1DText, date, time+2 ,middle1D) else begin middle1DText = Text_New(DATE, TIME+2 , middle1D, " 1 Day BPOINT ("+numtostr(middle1D,4)+")"); Text_SetStyle (middle1DText, 0, 1); TEXT_SETCOLOR(middle1DText, middleYesterdayTLColor); end; end; //4 days if (Use4Day) then begin High4D = MaxList(HighD(1), HighD(2), HighD(3), HighD(4)); Low4D = MinList(LowD(1), LowD(2),LowD(3), LowD(4)); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High4D = MaxList(HighD(0), HighD(1), HighD(2), HighD(3)); Low4D = MinList(LowD(0), LowD(1), LowD(2), LowD(3)); end else if((DayOfWeek(currentDate) = 1 or DayOfWeek(currentDate) =2 or DayOfWeek(currentDate) = 3 or DayOfWeek(currentDate) = 4) and (bartype<>2 and isGlobex=false)) then begin High4D = MaxList(HighD(1),HighD(2), HighD(3), HighD(4), HighD(5)); Low4D = MinList(LowD(1),LowD(2), LowD(3),LowD(4), LowD(5)); end; middle4D = Low4D+(High4D-Low4D)/2; tempdaysback = numOfDays+3; if (dayofweek(date) = 4 or dayofweek(date) = 3 or dayofweek(date) = 2) then begin if (isGlobex=false) then tempdaysback = 7 else tempdaysback = 6; end else if (dayofweek(date) = 5) then begin if (isGlobex=false) then tempdaysback = 5 else tempdaysback = 4; if (SessionEndTime(1,5) = time) then tempdaysback = tempdaysback-1; end; if (prev4DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev4DHighTrendLine, JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1,SessionNum), High4D) else TL_SetBegin(prev4DHighTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), High4D); TL_SetEnd(prev4DHighTrendLine, Date, Time+2, High4D); end else begin if (bartype = 2) then prev4DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1,SessionNum) , High4D, DATE, time+2 , High4D) else prev4DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , High4D, DATE, time+2 , High4D); TL_SetColor(prev4DHighTrendLine, middle4dTLColor); TL_SetStyle(prev4DHighTrendLine, 4); end; if (prev4DHighText > 0) then Text_SetLocation (prev4DHighText, date, time+2 ,High4D) else begin prev4DHighText = Text_New(DATE, TIME+2 , High4D, " 4 Day High ("+numtostr(High4D,4)+")"); Text_SetStyle (prev4DHighText, 0, 2); TEXT_SETCOLOR(prev4DHighText, middle4dTLColor); end; if (prev4DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev4DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1,SessionNum), Low4D) else TL_SetBegin(prev4DLowTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), Low4D); TL_SetEnd(prev4DLowTrendLine, Date, Time+2, Low4D); end else begin if (bartype = 2) then prev4DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1, SessionNum) , Low4D, DATE, time+2, Low4D) else prev4DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1, SessionNum) , Low4D, DATE, time+2, Low4D); TL_SetColor(prev4DLowTrendLine, middle4dTLColor); TL_SetStyle(prev4DLowTrendLine, 4); end; if (prev4DLowText > 0) then Text_SetLocation (prev4DLowText, date, time+2 ,Low4D) else begin prev4DLowText = Text_New(DATE, TIME+2 , Low4D, " 4 Day Low ("+numtostr(Low4D,4)+")"); Text_SetStyle (prev4DLowText, 0, 2); TEXT_SETCOLOR(prev4DLowText, middle4dTLColor); end; if (middle4DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle4DTL, JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1,SessionNum), middle4D) else TL_SetBegin(middle4DTL, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), middle4D); TL_SetEnd(middle4DTL, Date, Time+2, middle4D); end else begin if (bartype = 2) then middle4DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev4Days])), SessionStartTime(1,SessionNum) , middle4D, DATE, time+2, middle4D) else middle4DTL= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , middle4D, DATE, time+2, middle4D); TL_SETSIZE(middle4DTL, 2); TL_SetColor(middle4DTL, middle4dTLColor); end; if (middle4DText > 0) then Text_SetLocation (middle4DText, date, time+2 ,middle4D) else begin middle4DText = Text_New(DATE, TIME+2 , middle4D, " 4 Day BPOINT ("+numtostr(middle4D,4)+")"); Text_SetStyle (middle4DText, 0, 2); TEXT_SETCOLOR(middle4DText, middle4dTLColor); end; end; //5 days if (Use5Day) then begin High5D = MaxList(HighD(1), HighD(2), HighD(3), HighD(4), HighD(5)); Low5D = MinList(LowD(1), LowD(2),LowD(3), LowD(4), LowD(5)); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High5D = MaxList(HighD(0), HighD(1), HighD(2), HighD(3), HighD(4)); Low5D = MinList(LowD(0), LowD(1), LowD(2), LowD(3), LowD(4)); end else if(DayOfWeek(currentDate) = 1 or DayOfWeek(currentDate) = 2 or DayOfWeek(currentDate) = 3 or DayOfWeek(currentDate) = 4) and (bartype<>2 and isGlobex=false) then begin High5D = MaxList(HighD(1),HighD(2), HighD(3), HighD(4), HighD(5), HighD(6)); Low5D = MinList(LowD(1), LowD(2), LowD(3),LowD(4), LowD(5), LowD(6)); end; middle5D = Low5D+(High5D-Low5D)/2; tempdaysback = numOfDays+4; if (dayofweek(date) = 4 or dayofweek(date) = 5 or dayofweek(date) = 3 or dayofweek(date) = 2) then if (isGlobex=false) then tempdaysback = 8 else tempdaysback = 7; if (prev5DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev5DHighTrendLine, JulianToDate(DateToJulian(Date[numOfPrev5Days+1])), SessionStartTime(1,SessionNum), High5D) else begin if (dayofweek(date) = 5) then TL_SetBegin(prev5DHighTrendLine, JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1,SessionNum), High5D) else TL_SetBegin(prev5DHighTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), High5D); end; TL_SetEnd(prev5DHighTrendLine, Date, Time+2, High5D); end else begin if (bartype = 2) then prev5DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev5Days])), SessionStartTime(1,SessionNum) , High5D, DATE, time+2 , High5D) else if (dayofweek(date) = 5) then prev5DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1,SessionNum) , High5D, DATE, time+2 , High5D) else prev5DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , High5D, DATE, time+2 , High5D); TL_SetColor(prev5DHighTrendLine, middle5dTLColor); TL_SetStyle(prev5DHighTrendLine, 4); end; if (prev5DHighText > 0) then Text_SetLocation (prev5DHighText, date, time+2 ,High5D) else begin prev5DHighText = Text_New(DATE, TIME+2 , High5D, " 5 Day High ("+numtostr(High5D,4)+")"); Text_SetStyle (prev5DHighText, 0, 0); TEXT_SETCOLOR(prev5DHighText, middle5dTLColor); end; if (prev5DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev5DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrev5Days])), SessionStartTime(1,SessionNum), Low5D) else if (dayofweek(date) = 5) then TL_SetBegin(prev5DLowTrendLine, JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1,SessionNum), Low5D) else TL_SetBegin(prev5DLowTrendLine, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), Low5D); TL_SetEnd(prev5DLowTrendLine, Date, Time+2, Low5D); end else begin if (bartype = 2) then prev5DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev5Days])), SessionStartTime(1, SessionNum) , Low5D, DATE, time+2, Low5D) else if (dayofweek(date) = 5) then prev5DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1, SessionNum) , Low5D, DATE, time+2, Low5D) else prev5DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1, SessionNum) , Low5D, DATE, time+2, Low5D); TL_SetColor(prev5DLowTrendLine, middle5dTLColor); TL_SetStyle(prev5DLowTrendLine, 4); end; if (prev5DLowText > 0) then Text_SetLocation (prev5DLowText, date, time+2 ,Low5D) else begin prev5DLowText = Text_New(DATE, TIME+2 , Low5D, " 5 Day Low ("+numtostr(Low5D,4)+")"); Text_SetStyle (prev5DLowText, 0, 0); TEXT_SETCOLOR(prev5DLowText, middle5dTLColor); end; if (middle5DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle5DTL, JulianToDate(DateToJulian(Date[numOfPrev5Days])), SessionStartTime(1,SessionNum), middle5D) else if (dayofweek(date) = 5) then TL_SetBegin(middle5DTL, JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1,SessionNum), middle5D) else TL_SetBegin(middle5DTL, JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum), middle5D); TL_SetEnd(middle5DTL, Date, Time+2, middle5D); end else begin if (bartype = 2) then middle5DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev5Days])), SessionStartTime(1,SessionNum) , middle5D, DATE, time+2, middle5D) else if (dayofweek(date) = 5) then middle5DTL= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-6), SessionStartTime(1,SessionNum) , middle5D, DATE, time+2, middle5D) else middle5DTL= TL_NEW(JulianToDate(DateToJulian(Date)-tempdaysback), SessionStartTime(1,SessionNum) , middle5D, DATE, time+2, middle5D); TL_SETSIZE(middle5DTL, 2); TL_SetColor(middle5DTL, middle5dTLColor); end; if (middle5DText > 0) then Text_SetLocation (middle5DText, date, time+2 ,middle5D) else begin middle5DText = Text_New(DATE, TIME+2 , middle5D, " 5 Day BPOINT ("+numtostr(middle5D,4)+")"); Text_SetStyle (middle5DText, 0, 0); TEXT_SETCOLOR(middle5DText, middle5dTLColor); end; end; //10 days if (Use10Day) then begin High10D = MaxList(HighD(1), HighD(2), HighD(3), HighD(4), HighD(5), HighD(6), HighD(7), HighD(8), HighD(9), HighD(10)); Low10D = MinList(LowD(1), LowD(2),LowD(3), LowD(4), LowD(5), LowD(6), LowD(7),LowD(8), LowD(9), LowD(10)); if (DayOfWeek(currentDate) = 6 or DayOfWeek(currentDate) = 0) then begin High10D = MaxList(HighD(0),HighD(1), HighD(2), HighD(3), HighD(4), HighD(5), HighD(6), HighD(7), HighD(8), HighD(9)); Low10D = MinList(LowD(0), LowD(1), LowD(2),LowD(3), LowD(4), LowD(5), LowD(6), LowD(7),LowD(8), LowD(9)); end else if((bartype<>2 and isGlobex=false)) then begin High10D = MaxList(HighD(1), HighD(2), HighD(3), HighD(4), HighD(5), HighD(6),HighD(7), HighD(8), HighD(9), HighD(10), HighD(11), HighD(12)); Low10D = MinList(HighD(1), LowD(2), LowD(3),LowD(4), LowD(5), LowD(6),LowD(7), LowD(8),LowD(9), LowD(10), LowD(11), LowD(12)); end; middle10D = Low10D+(High10D-Low10D)/2; numOfDays = numOfDays+2; if (prev10DHighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev10DHighTrendLine, JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1,SessionNum), High10D) else TL_SetBegin(prev10DHighTrendLine, JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1,SessionNum), High10D); TL_SetEnd(prev10DHighTrendLine, Date, Time+2, High10D); end else begin if (bartype = 2) then prev10DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1,SessionNum) , High10D, DATE, time+2 , High10D) else prev10DHighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1,SessionNum) , High10D, DATE, time+2 , High10D); TL_SetColor(prev10DHighTrendLine, middle10dTLColor); TL_SetStyle(prev10DHighTrendLine, 4); end; if (prev10DHighText > 0) then Text_SetLocation (prev10DHighText, date, time+2 ,High10D) else begin prev10DHighText = Text_New(DATE, TIME+2 , High10D, " 10 Day High ("+numtostr(High10D,4)+")"); Text_SetStyle (prev10DHighText, 0, 1); TEXT_SETCOLOR(prev10DHighText, middle10dTLColor); end; if (prev10DLowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(prev10DLowTrendLine, JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1,SessionNum), Low10D) else TL_SetBegin(prev10DLowTrendLine, JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1,SessionNum), Low10D); TL_SetEnd(prev10DLowTrendLine, Date, Time+2, Low10D); end else begin if (bartype = 2) then prev10DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1, SessionNum) , Low10D, DATE, time+2, Low10D) else prev10DLowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1, SessionNum) , Low10D, DATE, time+2, Low10D); TL_SetColor(prev10DLowTrendLine, middle10dTLColor); TL_SetStyle(prev10DLowTrendLine, 4); end; if (prev10DLowText > 0) then Text_SetLocation (prev10DLowText, date, time+2 ,Low10D) else begin prev10DLowText = Text_New(DATE, TIME+2 , Low10D, " 10 Day Low ("+numtostr(Low10D,4)+")"); Text_SetStyle (prev10DLowText, 0, 1); TEXT_SETCOLOR(prev10DLowText, middle10dTLColor); end; if (middle10DTL > 0) then begin if (bartype = 2) then TL_SetBegin(middle10DTL, JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1,SessionNum), middle10D) else TL_SetBegin(middle10DTL, JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1,SessionNum), middle10D); TL_SetEnd(middle10DTL, Date, Time+2, middle10D); end else begin if (bartype = 2) then middle10DTL= TL_NEW(JulianToDate(DateToJulian(Date[numOfPrev10Days])), SessionStartTime(1,SessionNum) , middle10D, DATE, time+2, middle10D) else middle10DTL= TL_NEW(JulianToDate(DateToJulian(Date)-numOfDays-11), SessionStartTime(1,SessionNum) , middle10D, DATE, time+2, middle10D); TL_SETSIZE(middle10DTL, 2); TL_SetColor(middle10DTL, middle10dTLColor); end; if (middle10DText > 0) then Text_SetLocation (middle10DText, date, time+2 ,middle10D) else begin middle10DText = Text_New(DATE, TIME+2 , middle10D, " 10 Day BPOINT ("+numtostr(middle10D,4)+")"); Text_SetStyle (middle10DText, 0, 1); TEXT_SETCOLOR(middle10DText, middle10dTLColor); end; end; if (isGlobex = false) then begin if (DayOfWeek(date) = 6 or DayOfWeek(date)=0) then SessionNum = 1 else SessionNum = DayOfWeek(date); if (HighTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(HighTrendLine, JulianToDate(DateToJulian(Date[1])), SessionStartTime(1,SessionNum), HighD(0)) else TL_SetBegin(HighTrendLine, JulianToDate(DateToJulian(Date)-1), SessionStartTime(1,SessionNum), HighD(0)); TL_SetEnd(HighTrendLine, Date, Time+2, HighD(0)); end else begin if (bartype = 2) then HighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[1])), SessionStartTime(1,SessionNum) , HighD(0), DATE, time+2 , HighD(0)) else HighTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-1), SessionStartTime(1,SessionNum) , HighD(0), DATE, time+2 , HighD(0)); TL_SetColor(HighTrendLine, White); TL_SETSIZE(HighTrendLine, 2); end; if (HighText > 0) then begin Text_SetLocation (HighText, date, time+2 , HighD(0)); Text_SetString (HighText, numtostr(HighD(0),4)); end else begin HighText = Text_New(DATE, TIME+2 , HighD(0), " Today Globex High ("+numtostr( HighD(0),4)+")"); Text_SetStyle (HighText, 0, 2); TEXT_SETCOLOR(HighText, White); end; if (LowTrendLine > 0) then begin if (bartype = 2) then TL_SetBegin(LowTrendLine, JulianToDate(DateToJulian(Date[1])), SessionStartTime(1,SessionNum), LowD(0)) else TL_SetBegin(LowTrendLine, JulianToDate(DateToJulian(Date)-1), SessionStartTime(1,SessionNum), LowD(0)); TL_SetEnd(LowTrendLine, Date, Time+2, LowD(0)); end else begin if (bartype = 2) then LowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date[1])), SessionStartTime(1,SessionNum) , LowD(0), DATE, time+2 , LowD(0)) else LowTrendLine= TL_NEW(JulianToDate(DateToJulian(Date)-1), SessionStartTime(1,SessionNum) , LowD(0), DATE, time+2 , LowD(0)); TL_SetColor(LowTrendLine, White); TL_SETSIZE(LowTrendLine, 2); end; if (LowText > 0) then begin Text_SetLocation (LowText, date, time+2 ,LowD(0)); Text_SetString (LowText, numtostr(LowD(0),4)); end else begin LowText = Text_New(DATE, TIME+2 , LowD(0), " Today Globex Low ("+numtostr( LowD(0),4)+")"); Text_SetStyle (LowText, 0, 2); TEXT_SETCOLOR(LowText, White); end; end; end;