WTRTI (War Thunder Real Time Information) is a helper program created by GitHub User MeSoftHorny, available on the project's GitHub page here. With it, you can add custom indicators in addition to the built in ones, either by adding existing but not implemented State variables, or by using a LUA script to do math on any number of State indicators to return a customized indicator.
For example, I regularly use SEP (Specific Excess Power, essentially how many m/s of power the engine is producing that can be used to either increase the speed of the plane or climb with.) and the Climb rate (labeled as the State Vy), to help determine an optimal climb rate, so that I can get to speed then climb at the max speed possible without losing speed by keeping Vy below SEP. To assist me in this, I created a custom indicator I called Excess Power, shortened to XSPWR using a lua script included in this.
To create your own or to use mine, simply go into WTRTI, click add indicator, then click user made, this will likely be blank. Right click the white space and select new. Name it whatever you want, if you want to use mine, name it XSPWR (or just change the folder name later to whatever you put the name as) and check the Lua Script box. Enter one of the State Variables into the State box, in my example, that should be "Vy, m/s", and then it will create a folder called Indicators with another folder with whatever you named it, in my case, XSPWR, along with two files: Description and update.lua. You can simply download the update.lua file (renamed to XSPWR.lua on here for clarity) and overwrite the existing update.lua file. Or you can just edit the update.lua file to match that of the XSPWR.lua file. Your choice.
I found during testing that I was unable to get it to work without using the State section of the custom Indicator to pass a variable to the script. You can only pass one variable this way -- it will be pass to the lua script as "in_value" variable, any other state variable you might need can retrieved via the getStateValue("INSERT_STATE_NAME") function.
See the below example for a very simple script. all it is doing is taking the Specific Excess Power variable as well as the climb rate (Vy), and subtracting Vy from SEP, then returning the result. Much more complicated scripts can be made than this.
The Description file (no file extension) contains the information needed that is created in the WTRTI custom Indicator creation tool, and I've named it such that it is "Indicator_Name_Description", be sure to rename it to Description once in the proper directory.
Additional information on creating Custom Indicators can be found on the forum post for WTRTI here. Scroll down to "Custom Indicators" and expand the spoiler tag. The entire post is helpful in detailing how it works. Importantly, LUA scripts only work in version 2.0+. As of writing, the current version is v2.1.
@Genious28 I have no idea how to generate it independently, it doesn't seem correlated to the lua file, but to set up a new indicator you have to go into WTRTI, click add indicator, then click new in the top left corner, give it the proper variables and units, etc, click Lua script, and then it'll generate the Description and lua file for you in a folder with the name you put for the new indicator. Simply edit the lua file in that folder (don't change the names of the files), and you should be good. If you need to edit the values in the description file, make sure you go through WTRTI > Add Indictor > Edit [U] Indicator_Name and change them there.