Appearance
question:HI
answer:there! How can I assist you today?
question://High&Low Levels len = input(80, title='Length',group = 'Higher High-Lower Low / ZIGZAG') Depth = len Deviation = input.int(1, 'Deviation', minval=1, step=1, group = 'Higher High-Lower Low / ZIGZAG') Backstep = input.int(5, 'Backstep', minval=1, step=1, group = 'Higher High-Lower Low / ZIGZAG') var last_h = 1 last_h += 1 var last_l = 1 last_l += 1 var lw = 1 lw += 1 var hg = 1 hg += 1 p_lw = -ta.lowestbars(Depth) p_hg = -ta.highestbars(Depth) lowing = lw == p_lw or low - low[p_lw] > Deviation * syminfo.mintick highing = hg == p_hg or high[p_hg] - high > Deviation * syminfo.mintick lh = ta.barssince(not highing[1]) ll = ta.barssince(not lowing[1]) down = ta.barssince(not(lh > ll)) >= Backstep lower = low[lw] > low[p_lw] higher = high[hg] < high[p_hg] if lw != p_lw and (not down[1] or lower) lw := p_lw < hg ? p_lw : 0 if hg != p_hg and (down[1] or higher) hg := p_hg < lw ? p_hg : 0 line zz = na label point = na x1 = down ? lw : hg y1 = down ? low[lw] : high[hg] if down == down[1] line.delete(zz[1]) label.delete(point[1]) if down != down[1] if down last_h := hg last_h else last_l := lw last_l zz := line.new(bar_index - (down ? last_h : last_l), down ? high[last_h] : low[last_l], bar_index - x1, y1, style=line.style_solid, width=2, color=down ? color.new(color.red,transp=50) : color.new(color.teal,transp=50)) point := label.new(bar_index - x1, y1, down ? low[x1] < low[last_l] ? 'LL' : 'HL' : high[x1] > high[last_h] ? 'HH' : 'LH', style=down ? label.style_label_up : label.style_label_down, size=size.small, color=down ? color.new(color.black, 0) : color.new(color.black, 0), textcolor=color.white, tooltip=down ? low[x1] < low[last_l] ? 'Lower Low' : 'Higher Low' : high[x1] > high[last_h] ? 'Higher High' : 'Lower High') //fibonacci lenf = input(80,title='Length',group = 'FIBONACCI') f2 = input.float(defval = 0.236, title = 'FIB 1', step=0.001, group = 'FIBONACCI') f3 = input.float(defval = 0.382, title = 'FIB 2', step=0.001, group = 'FIBONACCI') f4 = input.float(defval = 0.500, title = 'FIB 3', step=0.001, group = 'FIBONACCI') f5 = input.float(defval = 0.618, title = 'FIB 4', step=0.001, group = 'FIBONACCI') f6 = input.float(defval = 0.786, title = 'FIB 5', step=0.001, group = 'FIBONACCI') high_point = ta.highest(high,lenf) low_point = ta.lowest(low,lenf) diff = high_point - low_point fib1 = high_point fib2 = fib1 - diff * f2 fib3 = fib1 - diff * f3 fib4 = fib1 - diff * f4 fib5 = fib1 - diff * f5 fib6 = fib1 - diff * f6 fib7 = low_point ps1 = (fib1 > fib1[1]) plotshape(ps1, title='Latest Bulliesh Power', style=shape.triangleup, color=color.teal ,size=size.tiny, location=location.abovebar,editable = false) ps2 = (fib7 < fib7[1]) plotshape(ps2, title='LatestBearieshPower', style=shape.triangledown, color=color.red , size=size.tiny, location=location.belowbar,editable = false) fibx1=line.new(bar_index - x1,fib1,last_bar_index ,fib1,extend=extend.both, color = color.black,style = line.style_solid,width = 1) fibx4=line.new(bar_index - x1,fib4,last_bar_index ,fib4,extend=extend.both, color = color.black,style = line.style_dashed,width = 1) fibx7=line.new(bar_index - x1,fib7,last_bar_index ,fib7,extend=extend.both, color = color.black,style = line.style_solid,width = 1) line.delete(fibx1[1]) line.delete(fibx4[1]) line.delete(fibx7[1]) bt=box.new(bar_index - x1,fib1,last_bar_index+30,fib2,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_top,extend = extend.both) box.delete(bt[1]) bc=box.new(bar_index - x1,fib3,last_bar_index+30,fib5,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_center,extend = extend.both) box.delete(bc[1]) bb=box.new(bar_index - x1,fib6,last_bar_index+30,fib7,bgcolor = color.new(color.orange,90),border_color = color.new(color.black,100),text='',text_size = size.normal,text_halign = text.align_right,text_valign = text.align_bottom,extend = extend.both) box.delete(bb[1]) // //VWAP vwapAnchorInput = input.string("Daily", "Anchor", options = ["Daily", "Weekly", "Monthly"],group = 'VWAP') stdevMultiplierInput1 = input.float(1.618, "Standard Deviation Multiplier-1", step = 0.01, minval = 0.01,group = 'VWAP') stdevMultiplierInput2 = input.float(1.786, "Standard Deviation Multiplier-2", step = 0.01, minval = 0.01,group = 'VWAP') stdevMultiplierInput3 = input.float(2, "Standard Deviation Multiplier-3", step = 0.01, minval = 0.01,group = 'VWAP') anchorTimeframe = switch vwapAnchorInput "Daily" => "1D" "Weekly" => "1W" "Monthly" => "1M" anchor = timeframe.change(anchorTimeframe) [vwap1, upperx1, lowerx1] = ta.vwap(hlc3, anchor, stdevMultiplierInput1) vx1=plot(vwap1,color = color.new(color.blue,0),linewidth=2,editable = false,display = display.pane) vx2=plot(upperx1, color = color.new(color.red,0),linewidth=1,editable = false,display = display.pane) vx3=plot(lowerx1, color = color.new(color.green,0),linewidth=1,editable = false,display = display.pane) [vwap2, upperx2, lowerx2] = ta.vwap(hl2, anchor, stdevMultiplierInput2) vy1=plot(upperx2, color =color.new(color.red,0),linewidth=1,editable = false,display = display.pane) vy2=plot(lowerx2, color = color.new(color.green,0),linewidth=1,editable = false,display = display.pane) [vwap3, upperx3, lowerx3] = ta.vwap(hl2, anchor, stdevMultiplierInput3) vz1=plot(upperx3, color =color.new(color.red,0),linewidth=2,editable = false,display = display.pane) vz2=plot(lowerx3, color = color.new(color.teal,0),linewidth=2,editable = false,display = display.pane) fill(vz1,vz2,color = color.new(color.black,80),editable = false) fill(vx2,vz1,color = color.new(color.red,85),editable = false) fill(vx3,vz2,color = color.new(color.green,85),editable = false) //lOGO --------------------------------------------------------------------------------------- // // ---------------------------------------------------------------------------------------------- // var table logo = table.new(position.bottom_right, 1, 1) if barstate.islast table.cell(logo, 0, 0, '𝕂ℍ𝕆𝕆𝕃𝕀𝕆-𝟚𝟘𝟚𝟛', text_size=size.normal, text_color=#ff0000) //
answer:Hello! Is there anything specific you would like me to assist you with regarding this code?
question:EXPLAIN
answer:Certainly! The code includes three main parts: 1. High and Low Levels: This part of the code uses the Zigzag indicator to identify higher highs and lower lows in the price action of a security. It sets the length, deviation, and backstep parameters for the Zigzag indicator. It then determines the bars since the last higher high and the bars since the last lower low. Once it identifies the trend, it marks the last higher high or lower low bar with a line and a label. 2. Fibonacci: This section of the code calculates Fibonacci retracement levels based on the highest point and lowest point over a pre-defined length. The levels are set as input floats, and the code calculates their respective values. It also creates shapes pointing up or down depending on whether the latest retracement matches a bullish or bearish trend. Lastly, it creates boxes at the 1.618, 1.786, and 2.0 Fibonacci levels. 3. Volume Weighted Average Price (VWAP): This section of the code calculates the VWAP using three standard deviations and three different multipliers from the anchor timeframe. It also identifies the upper and lower VWAP bands using these multipliers. Finally, it plots the VWAP and the VWAP bands. The code also includes a logo table at the bottom right of the chart that displays "KHOOLOI-2023".
question:i need linear programing from this with objective function and constraints paragraph: Inside the factory, there are 30 pots, the capacity of each pot is 15,000,000 roses, and each pot takes 12 hours to cook 15,000 roses to produce a box and a half of perfume. The number of workers per day is 20 workers for a period of 12 hours to 45 days.
answer:Objective function: Maximize the total number of boxes of perfume produced in a 45-day period. Variables: Let x be the number of boxes of perfume produced per 12-hour shift. Constraints: - Each pot can produce 15,000,000/15,000 = 1,000 boxes of perfume per shift. 30 pots x 1,000 boxes/pot = 30,000 boxes per shift - There are 2 shifts per day for a total of 24 hours of production. 2 x 15 shifts = 30 shifts per month - The total number of shifts in a 45-day period is 30 x 45 = 1,350. - A box and a half of perfume requires 15,000 roses and 12 hours of cooking time. - The number of roses available is not specified. Therefore, assume that the limiting factor is the number of workers. - 20 workers are available per shift for a period of 12 hours for 45 days. - Workers can only work for a maximum of 8 hours per day due to labor laws. - The number of workers per day is 20 workers for a period of 12 hours to 45 days. 20 workers x 8 hours/day = 160 worker-hours per day 160 worker-hours/day x 30 shifts/month = 4,800 worker-hours per month Equations: - Each shift can produce x boxes of perfume - The total number of boxes produced in a 45-day period is: Objective function: maximize Z = 1,350 x - The number of roses used per day is: 15,000 roses/12 hours/1.5 boxes = 1,000 roses per box 1,000 roses/box x x boxes/shift x 2 shifts/day = 2,000x roses/day - The number of worker-hours used per day is: 20 workers/shift x 8 hours/worker = 160 worker-hours/shift 160 worker-hours/shift x 2 shifts/day = 320 worker-hours/day - The number of roses and worker-hours used in a 45-day period are: 45 days x 2,000x roses/day = 90,000x roses 45 days x 320 worker-hours/day = 14,4000 worker-hours Constraints: 90,000x roses <= total number of available roses 14,400 worker-hours <= total number of available worker-hours