// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Zone.java
// public enum Zone {
//     
//     SELL(true),
//     BUY_HOLD(false),
//     PROFIT_TAKE_HOLD(false),
//     PROFIT_TAKE(true);
//     
//     private final boolean mandatory;
// 
//     Zone(boolean mandatory) {
//         this.mandatory = mandatory;
//     }
// 
//     public boolean isMandatory() {
//         return mandatory;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/StubDataTestUtils.java
// public class StubDataTestUtils {
// 
//     private static final String SEPARATOR = ",";
//     private static final String COMMENT_LINE = "#";
//     private static final int TIMESTAMP = 0;
//     private static final int OPEN = 1;
//     private static final int HIGH = 2;
//     private static final int LOW = 3;
//     private static final int CLOSE = 4;
//     private static final int VOLUME = 5;
// 
//     private StubDataTestUtils() {}
// 
//     public static List<Tick> createTickData(String stubData) {
//         return createTickData(stubData, SEPARATOR, null, null);
//     }
//     
//     public static List<Tick> createTickData(String stubData, DateTimeFormatter dtf) {
//         return createTickData(stubData, SEPARATOR, null, dtf);
//     }
// 
//     public static List<Tick> createTickData(String stubData, String separator, Pattern header, DateTimeFormatter dtf) {
//         List<Tick> ticks = new ArrayList<>();
//         BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(StubDataTestUtils.class.getResourceAsStream(stubData)));
//         String line;
//         try {
//             while ((line = bufferedReader.readLine()) != null) {
//                 String[] data = line.split(separator);
//                 if (data == null || (header != null && header.matcher(line).matches()) || line.startsWith(COMMENT_LINE)) { // Headers, comments, no data
//                     continue;
//                 }
//                 DateTime dt = dtf != null ? DateTime.parse(data[TIMESTAMP], dtf) : DateTime.parse(data[TIMESTAMP]);
//                 Tick tick = new Tick(dt, Double.parseDouble(data[OPEN]), Double.parseDouble(data[HIGH]), Double.parseDouble(data[LOW]),
//                         Double.parseDouble(data[CLOSE]), Double.parseDouble(data[VOLUME]));
//                 ticks.add(tick);
//             }
//             bufferedReader.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//         return ticks;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/Assertions.java
// public static void assertDecimalEquals(TADecimal actual, String expected) {
//     if (expected != null) {
//         assertNotNull(actual);
//         assertThat(actual).isEqualTo(TADecimal.valueOf(expected));
//     } else {
//         assertNull(actual);
//     }
// }


import au.net.woodberry.ta.toolbox.enums.Zone;
import au.net.woodberry.ta.toolbox.indicators.StubDataTestUtils;
import eu.verdelhan.ta4j.TimeSeries;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.junit.Test;
import static au.net.woodberry.ta.toolbox.indicators.Assertions.assertDecimalEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
    }

    @Test
    public void testUpperDeviationValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getUpperDeviation(), 4278.7562);
    }

    @Test
    public void testLowerDeviationValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getLowerDeviation(), 4054.7031);
    }

    @Test
    public void testCentralCordValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getCentralCord(), 4156.5454);
    }
    
    @Test
    public void testInZoneProfitTake() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
// Path: src/main/java/au/net/woodberry/ta/toolbox/enums/Zone.java
// public enum Zone {
//     
//     SELL(true),
//     BUY_HOLD(false),
//     PROFIT_TAKE_HOLD(false),
//     PROFIT_TAKE(true);
//     
//     private final boolean mandatory;
// 
//     Zone(boolean mandatory) {
//         this.mandatory = mandatory;
//     }
// 
//     public boolean isMandatory() {
//         return mandatory;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/StubDataTestUtils.java
// public class StubDataTestUtils {
// 
//     private static final String SEPARATOR = ",";
//     private static final String COMMENT_LINE = "#";
//     private static final int TIMESTAMP = 0;
//     private static final int OPEN = 1;
//     private static final int HIGH = 2;
//     private static final int LOW = 3;
//     private static final int CLOSE = 4;
//     private static final int VOLUME = 5;
// 
//     private StubDataTestUtils() {}
// 
//     public static List<Tick> createTickData(String stubData) {
//         return createTickData(stubData, SEPARATOR, null, null);
//     }
//     
//     public static List<Tick> createTickData(String stubData, DateTimeFormatter dtf) {
//         return createTickData(stubData, SEPARATOR, null, dtf);
//     }
// 
//     public static List<Tick> createTickData(String stubData, String separator, Pattern header, DateTimeFormatter dtf) {
//         List<Tick> ticks = new ArrayList<>();
//         BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(StubDataTestUtils.class.getResourceAsStream(stubData)));
//         String line;
//         try {
//             while ((line = bufferedReader.readLine()) != null) {
//                 String[] data = line.split(separator);
//                 if (data == null || (header != null && header.matcher(line).matches()) || line.startsWith(COMMENT_LINE)) { // Headers, comments, no data
//                     continue;
//                 }
//                 DateTime dt = dtf != null ? DateTime.parse(data[TIMESTAMP], dtf) : DateTime.parse(data[TIMESTAMP]);
//                 Tick tick = new Tick(dt, Double.parseDouble(data[OPEN]), Double.parseDouble(data[HIGH]), Double.parseDouble(data[LOW]),
//                         Double.parseDouble(data[CLOSE]), Double.parseDouble(data[VOLUME]));
//                 ticks.add(tick);
//             }
//             bufferedReader.close();
//         } catch (IOException e) {
//             throw new RuntimeException(e);
//         }
//         return ticks;
//     }
// }
// 
// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/Assertions.java
// public static void assertDecimalEquals(TADecimal actual, String expected) {
//     if (expected != null) {
//         assertNotNull(actual);
//         assertThat(actual).isEqualTo(TADecimal.valueOf(expected));
//     } else {
//         assertNull(actual);
//     }
// }


// Path: src/test/java/au/net/woodberry/ta/toolbox/indicators/volatility/RangeIndicatorTest.java
import au.net.woodberry.ta.toolbox.enums.Zone;
import au.net.woodberry.ta.toolbox.indicators.StubDataTestUtils;
import eu.verdelhan.ta4j.TimeSeries;
import org.joda.time.format.DateTimeFormat;
import org.joda.time.format.DateTimeFormatter;
import org.junit.Test;
import static au.net.woodberry.ta.toolbox.indicators.Assertions.assertDecimalEquals;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;

    }

    @Test
    public void testUpperDeviationValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getUpperDeviation(), 4278.7562);
    }

    @Test
    public void testLowerDeviationValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getLowerDeviation(), 4054.7031);
    }

    @Test
    public void testCentralCordValue() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertNotNull(indicator.getValue(13));
        assertDecimalEquals(indicator.getValue(13).getCentralCord(), 4156.5454);
    }
    
    @Test
    public void testInZoneProfitTake() {
        TimeSeries data = new TimeSeries(StubDataTestUtils.createTickData("/TEST_RANGE_INDICATOR_TC1.stub", DTF));
        RangeIndicator indicator = new RangeIndicator(data);
        assertEquals(Zone.PROFIT_TAKE, indicator.getValue(48).getZone());