Is it possible to add a custom drop-down menu for the configuration screen to let you toggle sub-settings?

Mr_Wheeler

Member
Something like this but custom.

kjMyiPO.png
 
Solution
Something like this but custom.

kjMyiPO.png

One way is with a switch statement

Capture.jpg

Ruby:
input currentprice = {default close, close2m, close3m, close15m};
def price;
switch (currentprice) {
case close:
    price = close;
case close2m:
    price = close(period = AggregationPeriod.TWO_MIN);
case close3m:
    price = close(period = AggregationPeriod.THREE_MIN);
case close15m:
    price = close(period=aggregationPeriod.FIFTEEN_MIN);
}
plot y = ExpAverage(price, 8);

SleepyZ

Well-known member
Something like this but custom.

kjMyiPO.png

One way is with a switch statement

Capture.jpg

Ruby:
input currentprice = {default close, close2m, close3m, close15m};
def price;
switch (currentprice) {
case close:
    price = close;
case close2m:
    price = close(period = AggregationPeriod.TWO_MIN);
case close3m:
    price = close(period = AggregationPeriod.THREE_MIN);
case close15m:
    price = close(period=aggregationPeriod.FIFTEEN_MIN);
}
plot y = ExpAverage(price, 8);
 
Solution

Mr_Wheeler

Member
Thank you. It should help with this study that I'm working on. I wanted to switch between displaying the stock price, and stock profit taking goals that you can configure in the study's options.


fnspQB6.png
 

Similar threads

Top