# \[Legacy] How exactly LuxSignals works

## Why you need to change inputs

LuxSignals is on tradingview\.com, which uses the coding language "Pine Script" for its indicators. Unfortunately, Pine Script is very limited in its capabilities and can't run too many calculations at a time or can't make multiple backtests at once. Each backtest with different settings requires an indicator to load again.

An indicator will load when it's added to the chart or if its settings have changed.

This is why you have to change LuxSignals' inputs a few times so it can collect the necessary data from backtests over time to decide on its best settings. With Pine Script it's impossible to run so many backtests at once, it would require it to load longer than a minute at once, but the limit for TradingView's free tier is 20 seconds.&#x20;

## How LuxSignals' algorithm works

LuxSignals actually only has two inputs: Input 1 and Input 2. The minimum input for each is 2, the maximum LuxSignals can recommend is 200 (That's for the Ultimate, for Plus and Basic it's only 100). You can also use higher numbers than 200 to see its backtesting results.

At the end of each process (changing the inputs many times), you will receive the best settings for the exact chart and timeframe you are on for the starting settings you had. You might receive different best settings depending on the settings you started with. There aren't that many "best settings" - we speculate there to be around 10 to 20 of them under the 40'000 possible combinations. All of them are very good, but some of them are better.

The only way you can achieve better best settings is by using different starting settings (on default they are 10 and 21), you can try random ones or follow an order (we usually try the following in this order: 2 and 2, default settings, 50 and 50, 200 and 200 (for 200 and 200 you have to start with the extension on),  100 and 100)

In total LuxSignals has to decide on one settings pair of Input 1 and Input 2 from 40'000 possible ones (200 x 200 possible combinations). It does that by calculating the hypothetical backtesting results (the profit factor) of 100 different settings at once.

You can control for which Input these hypothetical results are with the "optimize for" setting. So if you optimize for Input 1, LuxSignals calculates 100 hypothetical results for all possible inputs of Input 1, ranging from 2 to 100. When you use extension, it tests the inputs from 100 to 200. The same goes for Input 2.

Now Input 1 and Input 2 affect each other's backtesting results, that's why you have to switch between optimizing for one to another.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://luxsignals.gitbook.io/luxsignals/focus/luxsignals-legacy/markdown.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
