_SECTION_BEGIN("Price"); SetChartOptions(0,chartShowArrows|chartShowDates); _N(Title = StrFormat("{{NAME}} - {{INTERVAL}} {{DATE}} {{OHLCX}} Vol %.0f {{VALUES}}", V )); Plot( C, "Close", ParamColor("Color", colorDefault ), styleNoTitle | ParamStyle("Style") | GetPriceStyle() ); _SECTION_END(); _SECTION_BEGIN("Chandelier Exit Preview"); YourHold = BarIndex() - SelectedValue(BarIndex()); //How many bars between the selected bar AND each bar following Multiple = Param("Multiple", 3, 1, 10, 1); //How many ATR?s to be allowed below the Highest High since selected bar ATRPeriods = Param("ATR Periods", 22, 1, 50, 1); //How many periods to use for the ATR Graph1 = HHV(Close,YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest Close Graph2 = HHV(High, YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest High Graph3 = LLV(Low, YourHold) + (Multiple * ATR(ATRPeriods)); //Chanderlier exit from Lowest Low (used when going Short) Plot(Graph1, "ChandClose", ParamColor( "ChandClose Color", colorCycle ), ParamStyle("ChandClose Style") ); Plot(Graph2, "ChandHigh", ParamColor( "ChandHigh Color", colorCycle ), ParamStyle("ChandHigh Style") ); Plot(Graph3, "ChandLow", ParamColor( "ChandLow Color", colorCycle ), ParamStyle("ChandLow Style") ); _SECTION_END(); _SECTION_BEGIN("Chandelier Exit"); YourHold = BarIndex() - ValueWhen(EMA(C,25) > C, BarIndex(), 1);//Replace 'EMA(C,25) > C' with your 'buy' formula Multiple = Param("Multiple", 3, 1, 10, 1); //How many ATR?s to be allowed below the Highest High since latest "buy" bar ATRPeriods = Param("ATR Periods", 22, 1, 50, 1); //How many periods to use for the ATR Graph1 = HHV(Close,YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest Close Graph2 = HHV(High, YourHold) - (Multiple * ATR(ATRPeriods)); //Chandelier exit line from Highest High Graph3 = LLV(Low, YourHold) + (Multiple * ATR(ATRPeriods)); //Chanderlier exit from Lowest Low (used when going Short) Plot(Graph1, "ChandClose", ParamColor( "ChandClose Color", colorCycle ), ParamStyle("ChandClose Style") ); Plot(Graph2, "ChandHigh", ParamColor( "ChandHigh Color", colorCycle ), ParamStyle("ChandHigh Style") ); Plot(Graph3, "ChandLow", ParamColor( "ChandLow Color", colorCycle ), ParamStyle("ChandLow Style") ); _SECTION_END(); // Buy = EMA(C,25) > C; Sell = EMA(C,25) < C OR Cross(Graph1, Close); //Use the appropriate Graph1, Graph2 OR Graph3 for whichever Chandelier exit you wish Short = Sell; Cover = Buy; _SECTION_END();