8/28/2023 0 Comments Define session high![]() ![]() ![]() Clean up those abbreviations so the code is readable and implement SecondsTillTime() and/or SecondsFromTime() functions instead of RegularTradingEnd().Citrix HDX is a suite of proprietary technologies that delivers a high-definition experience to users of virtual desktops and virtual applications. So go back to the charts and rework your code. We need code that is very easy to read and understand. I only allow about 15 mins to provide solutions in the Q&A forum. But those abbreviations are making that too difficult. I usually will take the time to explain where the code is wrong and teach you how to correct things. Plot data = RegularTradingEnd(GetYYYYMMDD()) ![]() Simply plot the following as a lower study on a chart and you will see why: The use of the function named RegularTradingEnd() is not going to work here. HOD should be highOfDay, LOD should be lowOfDay. So spell things out in your variable names. Especially when the code does not work and the only way to tell what you are trying to do is to read the code. Using abbreviations in the code makes it much more difficult to read and understand. The first problem I have though is the use of the following abbreviations: ONH, ONL, ON. I am inclined to start from scratch here rather than try to modify your code. #Plots on Watchlist with Text Color CodingĪddLabel (yes,if Both then "BOTH" else if ONH then "ONH" else if ONL then "ONL" else "-", if Both or ONH then Color.Black else Color.White) Įlse if ONH then CreateColor(175,250,175) Rec RTH_Low = if First_Bar and !First_Bar then low else if First_Bar and low 0 then low else RTH_Low ĭef Both = RTH_High > PreMktHigh and RTH_Low PreMktHigh Rec RTH_High = if First_Bar and !First_Bar then high else if First_Bar and high > RTH_High then high else RTH_High #Regular Trading Session Start/Ending Timesĭef RTH_TimeUntilClose = SecondsTillTime(First_Bar_EndTime) ĭef RTH_TimeSinceOpen = SecondsfromTime(First_Bar_StartTime) ĭef First_Bar = RTH_TimeSinceOpen >= 0 and RTH_TimeUntilClose > 0 Rec PreMktLow = if PreMarketTargetPeriod and !PreMarketTargetPeriod then low else if PreMarketTargetPeriod and low 0 then low else PreMktLow Rec PreMktHigh = if PreMarketTargetPeriod and !PreMarketTargetPeriod then high else if PreMarketTargetPeriod and high > PreMktHigh then high else PreMktHigh #PreMarket Session Levels and Start/Ending Timesĭef PreMarketUntilClose = SecondsTillTime(PreMarketEndTime) ĭef PreMarketSinceOpen = SecondsFromTime(PreMarketStartTime) ĭef PreMarketTargetPeriod = PreMarketUntilClose >= 0 and PreMarketSinceOpen > 0 # Thanks to for helping on how to solve issues. # Pre Market High / Low Levels Hit at last once wiht Color Coding. Idea is if to plot “BOTH”, if High>ONH and LowONH, plot “ONL” if Low stageOne ĭef PMH = if premarketStart and premarketSession then high else if high > PMH and premarketSession then high else PMH ĭef PML = if premarketStart and premarketSession then low else if low stageOneR ĭef HOD = if stageOneR and RTHSession then high else if high > HOD and RTHSession then high else HOD ĭef LOD = if RTHStart and RTHSession then low else if low PMH and LOD PMH then “ONH” else if LOD < PML then “ONL” else “-“) So basically I need to fix how to reference the Low/High of day ONLY since the RTH Start. Using some of the code you posted on another study I was able to define and see the premarket levels on the watchlists.īut when I want to compare them to the RTH Low/High, given it’s working on intraday mode with Ext checked, it compares to the actual bar, not the Low /High of the day. I am looking to plot on a Watchlist column if the RTH Low / High Crossed Pre Market Low / High, and color code. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |