Script Convert Indicator Set To Comma Separated
Hello Community,
I have created a script in Powershell that converts the values of an indicator to the values needed to use in CP (CustomIndy) >= version 2.49
Hello Community,
I have created a script in Powershell that converts the values of an indicator to the values needed to use in CP (CustomIndy) >= version 2.49
The script was designed to run in Windows Powershell. You are free to modify it to run without the GUI so you can run it in Powershell on Linux.
in linux cannot exec .ps1
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:211
Line |
211 | $listBox_DragDrop = [System.Windows.Forms.DragEventHandler] {
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| Unable to find type [System.Windows.Forms.DragEventHandler].
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:218
Line |
218 | $button.Add_Click($button_Click)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:219
Line |
219 | $button2.Add_Click($button2_Click)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:220
Line |
220 | $button3.Add_Click($button3_Click)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:221
Line |
221 | $listBox.Add_DragOver($listBox_DragOver)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:222
Line |
222 | $listBox.Add_DragDrop($listBox_DragDrop)
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
InvalidOperation: /home/rnest/Downloads/CommunityPowerEA_Custom_Indicators_Settings.ps1:225
Line |
225 | [void] $form.ShowDialog()
| ~~~~~~~~~~~~~~~~~~~~~~~~~
| You cannot call a method on a null-valued expression.
PS /home/rnest/Downloads>
You must have both files in the same directory. Search Youtube/Google how to run a Powershell script.
BugFix:
Edit .ps1
Replace:
#Number
if ($value -match "^[\d\.]+$")
By:
#Number
if ($value -match "^[\d\.\-]+$")
Add "\-"
You have to save the indicator configuration and then drag this file (*.set) to the script to then copy the value from the Texbox below called "Indicator parameters (comma separated):" to the CP indicator, for example to #1 and set it. paste in the parameter "Indicator parameters (comma separated):" as indicated
The script automates putting all indicator values separated by commas.
This new version adds "Open" and "Clear" buttons to find and open the indicator configuration file and works on Linux, using Wine with Powershell for Windows
wineconsole PowerShell-7.4.6-win-x64/pwsh.exe -ExecutionPolicy Bypass -File CommunityPowerEA_Custom_Indicators_Settings.ps1
Powershell:
Releases · PowerShell/PowerShell
PowerShell-7.4.6-win-x64.zip
New Version:
CommunityPowerEA_Custom_Indicators_Settings.ps1
CommunityPowerEA_Custom_Indicators_Settings....bat