logo

Script Convert Indicator Set To Comma Separated

Avatar
  • updated

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

Image 3450

CommunityPowerEA_Custom_Indicators_Settings.ps1

Avatar
matyas

Ok. Thanks for clarifying. Looks like I will have to create an bridge-indi ( not me but AI :) . 

Otherwise for me this indi is alfa-omega for manual trading so I would like to automate it.

On chart you can switch it to simple mode, where you can see just two lines for underlying asset. 

For example like this one (XAUUSD on M5) where yellow is USD and green line is GOLD. You consider open position only if you see clear distance between the lines.

Image 6557

You can also switch to delta mode with one line.

Avatar
Ulises Cune
Quote from matyas

Hello Ulises. Thanks for creating this script. But I have a bit problem as trying to use it on custom indicator "FX Power MT5 NG" ( https://www.mql5.com/en/market/product/102576?source=Site+Profile+Seller ) . I get this error:  

CommunityPower MT5 (EURUSD.r,M5) Can't load "Market\FX Power MT5 NG.ex5" indy, error #4808! CommunityPower MT5 (EURUSD.r,M5) 89 leaked strings left

CommunityPower MT5 (EURUSD.r,M5) 1 undeleted dynamic object found:

CommunityPower MT5 (EURUSD.r,M5) 1 object of class 'CCustomIndy'

CommunityPower MT5 (EURUSD.r,M5) 8736 bytes of leaked memory found


What can be wrong ?

Indicator set file:

fx_power.set
 

My script isn't the problem. The indicator uses groups for parameters, and CP can't use them. It leaves the value blank in parameters.

Image 6551

Image 6552

Use CP with this setup:

Image 6553

I don't know how to use the indicator, but you should use some of the buffers it has to get the signals you want.

Image 6556


CP Example:

Test_v3.01.set


Config Default Indicator:

Settings.set

Avatar
matyas

Hello Ulises. Thanks for creating this script. But I have a bit problem as trying to use it on custom indicator "FX Power MT5 NG" ( https://www.mql5.com/en/market/product/102576?source=Site+Profile+Seller ) . I get this error:  

CommunityPower MT5 (EURUSD.r,M5) Can't load "Market\FX Power MT5 NG.ex5" indy, error #4808! CommunityPower MT5 (EURUSD.r,M5) 89 leaked strings left

CommunityPower MT5 (EURUSD.r,M5) 1 undeleted dynamic object found:

CommunityPower MT5 (EURUSD.r,M5) 1 object of class 'CCustomIndy'

CommunityPower MT5 (EURUSD.r,M5) 8736 bytes of leaked memory found


What can be wrong ?

Indicator set file:

fx_power.set
 

Avatar
Ulises Cune

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

Image 6239

Powershell:

Releases · PowerShell/PowerShell
PowerShell-7.4.6-win-x64.zip

New Version:

CommunityPowerEA_Custom_Indicators_Settings.ps1
CommunityPowerEA_Custom_Indicators_Settings....bat

Avatar
Ulises Cune

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.

Avatar
ferdinand tampubolon

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>

Avatar
Ulises Cune

You must have both files in the same directory. Search Youtube/Google how to run a Powershell script.

Avatar
Asad

Hey Ulises, 

I am trying to start the script but I am getting this error. 

What am I doing wrong here?

Image 5956

Avatar
Ulises Cune

BugFix

Edit .ps1

Replace:

#Number 

if ($value -match "^[\d\.]+$")

By:

#Number 

if ($value -match "^[\d\.\-]+$")

Add "\-"