How to Open Third-Party Custom Columns and Buttons
Hi,
To open a third-party custom column or button, go to the following folders:
ProtraderMC >> My Scripts >> CustomColumn >> copy and paste the .cs file for the custom column.
To use it in Protrader:
Right-click in the appropriate panel >> Settings >> Columns >> click on the plus arrow.
And that's about it.
Replies
apos muitas tentativas e erros consegui entender o funcionamento de algumas funções da NETColumn, segue exemplo de como ler o valor de um campo específico de uma tabela que está sendo customizado.
After many attempts and errors I was able to understand the operation of some functions of NETColumn, following example of how to read the value of a specific field of a table that is being customized.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using PTLRuntime.NETScript;
namespace Saldo_Operacoes
{
///
/// Saldo_Operacoes
/// Script para ler os valores da tabela de ORDENS EXECUTADAS
///
///
public class Saldo_Operacoes : NETColumn
{
public Saldo_Operacoes()
: base()
{
#region Initialization
base.Author = "Claudecir Santos";
base.Comments = "@ClaudecirSantos";
base.Company = "";
base.Copyrights = "";
base.DateOfCreation = "13.11.2017";
base.ExpirationDate = 0;
base.Version = "1.0";
base.Password = "66b4a6416f59370e942d353f08a9ae36";
base.ProjectName = "Saldo_Operacoes";
base.CustomColumnType = CustomColumnType.Value;
base.CustomSortType = CustomSortType.Double; // Campo novo criado na tabela
#endregion
}
///
/// Supported type of the panel
///
public override PanelType CurrentPanelType
{
get { return PanelType.FilledOrders; }
}
///
/// This function will be called to calculate the value of the column
/// ---------------------
/// Available columns:
/// (use index for greater performance)
/// --------------------
///
/// Index Name Localization Type
/// -------------------------------------------------------------------------
/// [0] Trade ID ID da negociação Int
/// [1] Order ID ID da ordem String
/// [2] Symbol Ativo String
/// [4] Side Lado String
/// [5] Quantity Quantidade Double
/// [6] Price Preço Double
/// [7] Execution fee Taxa de excução Double
/// [8] * Gross P/L L/P bruto Double
/// [9] Time Tempo DateTime
/// [10] Date Data DateTime
/// [15] Exposure Exposição Double
/// [17] Order type Tipo de ordem String
/// [18] Symb. type Tipo de Ativo String
/// [19] Net P/L L/P Líquido Double
/// [20] Bought Comprado Double
/// [21] Sold Vendido Double
/// [23] Strike price Preço 'Strike' Double
/// [24] Exp. date Vencimento DateTime
///
/// metodo para acessar a tabela especificada no script (ORDENS EXECUTADAS)
public override object GetValue(Row row)
{
var saldo = row.GetValue(19); // valor do lucro bruto - value of Net P/L
double sld_lido = Convert.ToDouble(saldo.ToString()); // faz a leitura da propriedade (vem como string) e converte para double
// reads property (comes as string) and converts to double
return sld_lido;
}
///
/// You can implement your custom formatting here
///
public override string FormatValue(object value, Row row)
{
return base.FormatValue(value, row);
}
}
}
Join PTMC community to post your replies on forum