Description
Example used in
using System;
using cAlgo.API;
using cAlgo.API.Collections;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Plugins
{
[Plugin(AccessRights = AccessRights.None)]
public class CustomWindowPlugIn : Plugin
{
private Button _buttonAddTakeProfit;
private Window _window;
protected override void OnStart()
{
_buttonAddTakeProfit = new Button
{
BackgroundColor = Color.SeaGreen,
Height = 50,
Text = "Add Take Profit"
};
_window.Child = _buttonAddTakeProfit;
_window.Show();
_buttonAddTakeProfit.Click += AddTakeProfit;
}
private void AddTakeProfit(ButtonClickEventArgs args)
{
foreach (var position in Positions)
{
if (position.TakeProfit is null)
{
position.ModifyTakeProfitPips(20);
}
}
}
protected override void OnStop()
{
// Handle Plugin stop here
}
}
}
Spotware
Joined on 23.09.2013
- Distribution: Free
- Language: C#
- Trading platform: cTrader Automate
- File name: Custom Window Plug In_withSourceCode.algo
- Rating: 0
- Installs: 346
- Modified: 20/06/2024 10:19
Note that publishing copyrighted material is strictly prohibited. If you believe there is copyrighted material in this section, please use the Copyright Infringement Notification form to submit a claim.
Comments
Log in to add a comment.
No comments found.