
Yo Nam

Info
Username: | yomm0401 |
Name: | Yo Nam |
Member since: | 11 Apr 2020 |
Country: | Thailand |
Favorite symbols:
About
Signature
Last Algorithm Comments
@Trend Line Alert: 21 Jun 2022, 07:41
What is not working? Please provide details.
@Auto Calculate Lots V4.2 ロット自動計算+決済機能: 30 May 2022, 14:18
Please do not include comments that are completely unrelated. johnbuttler196's comment has absolutely nothing to do with us. We are not responsible for any disadvantage caused by johnbuttler196's links.
@Trend Line Alert: 12 Sep 2021, 04:02
Please contact email as telegram cannot be used temporarily now. pwd8ja22cc@yahoo.co.jp
@Mirror Candle: 10 Sep 2021, 08:25
As far as I know,currently it is not possible to paint directly on the chart. I hope it can do it too.
@Cross Hair: 09 Sep 2021, 16:28
I mistake file. you can download from here. not this site.
@Back in time: 28 Mar 2021, 07:31
you need download from here https://gum.co/backintime I haven't published the source code It cannot be downloaded directly from this site. Best regards
@ADR: 22 Feb 2021, 09:30
TraderX54 I will deal with it. scobby545 This may mean that the sharp drop has moved 200% of the ADR price. Do you want to say that the overlapping display is a bug?
@Auto Calculate Lots Size V2: 14 Nov 2020, 10:42
Mr Richard sorry reply to late. please make link again. I can't see now.
@Profit Pips Today: 29 Jul 2020, 04:52
If the calculation period does not match, please adjust the time zone. TimeZone = TimeZones."Inset your timezone"
@MTF MA: 23 Jun 2020, 17:02
No I did not. but If you buy I can give this source code to you.
Last Forum Posts
@Is there a way to hide the indicator from the button I created on the chart?: 21 Apr 2022, 11:14
amusleh said:
Hi,
Try this:
using System; using cAlgo.API; using cAlgo.API.Internals; using cAlgo.API.Indicators; using cAlgo.Indicators; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)] public class SampleSMA : Indicator { [Parameter("Source")] public DataSeries Source { get; set; } [Parameter(DefaultValue = 14)] public int Periods { get; set; } [Output("Main")] public IndicatorDataSeries Result { get; set; } private ToggleButton togglebutton; private bool hideshow = true; protected override void Initialize() { buttonDraw(); } private void buttonDraw() { var stackPanel = new StackPanel { HorizontalAlignment = HorizontalAlignment.Center, VerticalAlignment = VerticalAlignment.Bottom, Margin = 20 }; togglebutton = new ToggleButton { Text = "Hide", Width = 80 }; togglebutton.Click += togglebuttonclick; stackPanel.AddChild(togglebutton); Chart.AddControl(stackPanel); } private void togglebuttonclick(ToggleButtonEventArgs arg) { if (togglebutton.IsChecked) { hideshow = false; togglebutton.Text = "Show"; for (int i = 0; i < Result.Count; i++) { Result[i] = double.NaN; } } else { hideshow = true; togglebutton.Text = "Hide"; for (int i = 0; i < Result.Count; i++) { Calculate(i); } } } public override void Calculate(int index) { if (hideshow) { double sum = 0.0; for (int i = index - Periods + 1; i <= index; i++) { sum += Source[i]; } Result[index] = sum / Periods; } } } }
Dear amusleh
you are great!
Thank you very much.
@Is there a way to hide the indicator from the button I created on the chart?: 21 Apr 2022, 04:57
Hello guys
I am looking for a way to hide the indicator from the button I created on the chart.
I have created the button on the chart, but do not know where to go from there.
Can someone please tell me how to do this?
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AutoRescale = false, AccessRights = AccessRights.None)]
public class SampleSMA : Indicator
{
[Parameter("Source")]
public DataSeries Source { get; set; }
[Parameter(DefaultValue = 14)]
public int Periods { get; set; }
[Output("Main")]
public IndicatorDataSeries Result { get; set; }
private ToggleButton togglebutton;
private bool hideshow = true;
protected override void Initialize()
{
buttonDraw();
}
private void buttonDraw()
{
var stackPanel = new StackPanel
{
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Bottom,
Margin = 20
};
togglebutton = new ToggleButton
{
Text = "Hide",
Width = 80
};
togglebutton.Click += togglebuttonclick;
stackPanel.AddChild(togglebutton);
Chart.AddControl(stackPanel);
}
private void togglebuttonclick(ToggleButtonEventArgs arg)
{
if (togglebutton.IsChecked)
{
hideshow = false;
togglebutton.Text = "Show";
}
else
{
hideshow = true;
togglebutton.Text = "Hide";
}
}
public override void Calculate(int index)
{
if (hideshow)
{
double sum = 0.0;
for (int i = index - Periods + 1; i <= index; i++)
{
sum += Source[i];
}
Result[index] = sum / Periods;
}
}
}
}
@Is there a bug in the value of bottomY?: 27 Dec 2021, 10:19
amusleh said:
Hi,
As I said it works fine on my system:
Can you tell what's you system graphics card? most probably that's the issue as it can't process fast enough that amount of data.
That's the most likely scenario.
However, when I tried it on a laptop without a high performance graphics card, it displayed correctly.
So that means the problem is with my graphics card.
Thank you for taking care of this for me at the busy end of the year.
Have a happy new year
@Is there a bug in the value of bottomY?: 24 Dec 2021, 12:02
amusleh said:
Hi,
I tired with your exact code and its working fine, I replicated your actions on the video and the bottom line didn't disappeared.
Can you tell me which broker cTrader you are using or which version? I tried on Spotware Beta cTrader 4.1.
I have also tested it with PulicBeta4.1 of SportWare cTrader, but it does not solve the problem of not showing up.
It looks like the video.
I thought it might be a memory issue, so I restarted the computer and checked with only one cTrader open.
Also, the specs of my computer is a desktop computer, Corei 7-7700K memory 16GB, so I don't think it's a problem.
@Is there a bug in the value of bottomY?: 24 Dec 2021, 09:13
amusleh said:
Hi,
It works fine, try this:
using System; using cAlgo.API; using cAlgo.API.Internals; namespace cAlgo { [Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)] public class TopYbottomYtest : Indicator { private double topY, bottomY; protected override void Initialize() { TopBottomYtest(); Chart.ScrollChanged += onscrollchanged; } private void onscrollchanged(ChartScrollEventArgs f) { TopBottomYtest(); } private void TopBottomYtest() { topY = Math.Round(Chart.TopY, Symbol.Digits); bottomY = Math.Round(Chart.BottomY, Symbol.Digits); Chart.DrawStaticText("test", "TOP " + topY.ToString() + " Bottom " + bottomY.ToString(), VerticalAlignment.Bottom, HorizontalAlignment.Center, Color.Red); Chart.DrawTrendLine("trendlinetesttop", Chart.FirstVisibleBarIndex, Chart.TopY, Chart.LastVisibleBarIndex, Chart.TopY, Color.Red, 30); Chart.DrawTrendLine("trendlinetestbottom", Chart.FirstVisibleBarIndex, Chart.BottomY, Chart.LastVisibleBarIndex, Chart.BottomY, Color.Red, 30); } public override void Calculate(int index) { } } }
Thanks for the reply.
I have confirmed that the BottomY trendline does not disappear with your code.
However, the problem is that it does not show up when I specify it using a number from "LastVisibleBarIndex".
I don't want to show the trendline on all the bottoms of the chart.
I want to show the trendline on all the bottoms of the chart using a number from "LastVisibleBarIndex".
I want to show the trendline on plus or minus several bars from the "LastVisibleBarIndex".
In this sense, I think it is a bug in cTrader.
@Is there a bug in the value of bottomY?: 23 Dec 2021, 12:17
Hi, I am creating an indicator using the TopY and bottomY values.
Sometimes when I draw a trendline based on these values, the line using the bottomY value does not show up.
When I use the TopY value, it is displayed correctly, so I think there is a bug in the bottomY value.
Or am I writing the code wrong?
Please help me.
using System;
using cAlgo.API;
using cAlgo.API.Internals;
using cAlgo.API.Indicators;
using cAlgo.Indicators;
namespace cAlgo
{
[Indicator(IsOverlay = true, TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class TopYbottomYtest : Indicator
{
private double topY, bottomY;
protected override void Initialize()
{
TopBottomYtest();
Chart.ScrollChanged += onscrollchanged;
}
private void onscrollchanged(ChartScrollEventArgs f)
{
TopBottomYtest();
}
private void TopBottomYtest()
{
topY = Math.Round(Chart.TopY, Symbol.Digits);
bottomY = Math.Round(Chart.BottomY, Symbol.Digits);
Chart.DrawStaticText("test", "TOP " + topY.ToString() + " Bottom " + bottomY.ToString(), VerticalAlignment.Bottom, HorizontalAlignment.Center, Color.Red);
Chart.DrawTrendLine("trendlinetesttop", Chart.LastVisibleBarIndex, Chart.TopY, Chart.LastVisibleBarIndex + 5, Chart.TopY, Color.Red, 30);
Chart.DrawTrendLine("trendlinetestbottom", Chart.LastVisibleBarIndex, Chart.BottomY, Chart.LastVisibleBarIndex + 5, Chart.BottomY, Color.Red, 30);
}
public override void Calculate(int index)
{
}
}
}
@Quicktrade button: 29 Nov 2021, 16:39
amusleh said:
Hi,
The order and price alert lines are under chart and the mouse events will not work while cursor is over them.
You can use Chart mouse leave and enter events to get the latest cursor position, if you move mouse over these lines the chart mouse leave event will be triggered and when you move back to other areas of chart the mouse enter event will be triggered.
Thank you amusleh.
It would be nice to have an event to ignore the order and price alert lines.
@Quicktrade button: 28 Nov 2021, 11:21
Is it possible to reproduce the Stop/Limit function of the Quicktrade button in Automate?
Can I drag and drop Stop/Limit orders to Place
I tried to set the entry price in "obj.Yvalue" using "MouseMoveEventArgs".
However, when there are other objects, such as a pending order, its Stop Loss, Takeprofit, or other horizontal line, I cannot get the Yvalue when the price is the same.
The selection is shifted to other objects.
Is there any way to solve this?
bestregards
using System;
using cAlgo.API;
using cAlgo.API.Indicators;
using cAlgo.API.Internals;
namespace cAlgo.Robots
{
[Robot(TimeZone = TimeZones.UTC, AccessRights = AccessRights.None)]
public class QuickTradingpanelStopLimittest : Robot
{
[Parameter("LineStyle", Group = "Horizontal Line", DefaultValue = LineStyle.Solid)]
public LineStyle hLS { get; set; }
[Parameter("Thickness", Group = "Horizontal Line", DefaultValue = 1)]
public int hThc { get; set; }
[Parameter("Color", Group = "Horizontal Line", DefaultValue = "DarkGoldenrod")]
public string hCol { get; set; }
[Parameter("Transparency", Group = "Horizontal Line", DefaultValue = 60, MinValue = 1, MaxValue = 100)]
public int hOpc { get; set; }
[Parameter("Vertical Alignment", Group = "Panel", DefaultValue = VerticalAlignment.Top)]
public VerticalAlignment OrderVerticalAlignment { get; set; }
[Parameter("Horizontal Alignment", Group = "Panel", DefaultValue = HorizontalAlignment.Right)]
public HorizontalAlignment OrderHorizontalAlignment { get; set; }
private StackPanel contentPanel;
private ToggleButton sellstoplimitbutton;
private bool sellSLbool;
private Color hColour;
private ChartHorizontalLine HorizontalLine;
private string _symbol;
private double defaultlots, testvolume;
protected override void OnStart()
{
defaultlots = 0.01;
testvolume = Chart.Symbol.QuantityToVolumeInUnits(defaultlots);
_symbol = Chart.SymbolName;
hOpc = (int)(255 * 0.01 * hOpc);
hColour = Color.FromArgb(hOpc, Color.FromName(hCol).R, Color.FromName(hCol).G, Color.FromName(hCol).B);
panel();
Chart.MouseMove += OnChartMouseMove;
Chart.MouseLeave += OnChartMouseLeave;
Chart.MouseDown += OnChartMouseDown;
}
private void OnChartMouseDown(ChartMouseEventArgs obj)
{
if (sellSLbool == true)
{
sellstoplimitorder(Math.Round(obj.YValue, Symbol.Digits));
sellstoplimitbutton.IsChecked = false;
sellSLbool = false;
}
Chart.RemoveObject("HorizontalLine");
Chart.RemoveObject("price");
}
private void sellstoplimitorder(double openprice)
{
if (openprice >= Symbol.Bid)
{
PlaceLimitOrderAsync(TradeType.Sell, _symbol, testvolume, openprice);
}
else if (openprice < Symbol.Bid)
{
PlaceStopOrderAsync(TradeType.Sell, _symbol, testvolume, openprice);
}
}
private void OnChartMouseMove(ChartMouseEventArgs obj)
{
if (sellSLbool == true)
{
if (sellSLbool == true)
{
HorizontalLine = Chart.DrawHorizontalLine("stoplimitHorizontalLine", obj.YValue, Color.FromHex("#F05824"), hThc, hLS);
if (Math.Round(obj.YValue, Symbol.Digits) >= Symbol.Bid)
{
var sprice = Chart.DrawText("stoplimitprice", "Sell Limit " + Math.Round(obj.YValue, Symbol.Digits).ToString(), Chart.FirstVisibleBarIndex, obj.YValue, Color.FromHex("#F05824"));
}
else if (Math.Round(obj.YValue, Symbol.Digits) < Symbol.Bid)
{
var sprice = Chart.DrawText("stoplimitprice", "Sell Stop " + Math.Round(obj.YValue, Symbol.Digits).ToString(), Chart.FirstVisibleBarIndex, obj.YValue, Color.FromHex("#F05824"));
}
}
}
}
void OnChartMouseLeave(ChartMouseEventArgs obj)
{
Chart.RemoveObject("stoplimitHorizontalLine");
Chart.RemoveObject("stoplimitprice");
}
private void panel()
{
var contetstyle = new Style();
contetstyle.Set(ControlProperty.CornerRadius, 3);
contetstyle.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#292929"), 0.85m), ControlState.DarkTheme);
contetstyle.Set(ControlProperty.BackgroundColor, GetColorWithOpacity(Color.FromHex("#FFFFFF"), 0.85m), ControlState.LightTheme);
contetstyle.Set(ControlProperty.Margin, "20 20 20 20");
var sellstoplimitstyle = new Style();
sellstoplimitstyle.Set(ControlProperty.BackgroundColor, Color.FromHex("#F05824"), ControlState.DarkTheme);
sellstoplimitstyle.Set(ControlProperty.BackgroundColor, Color.FromHex("#F05824"), ControlState.LightTheme);
sellstoplimitstyle.Set(ControlProperty.BackgroundColor, Color.FromHex("#8B0000"), ControlState.DarkTheme | ControlState.Checked);
sellstoplimitstyle.Set(ControlProperty.BackgroundColor, Color.FromHex("#8B0000"), ControlState.LightTheme | ControlState.Checked);
sellstoplimitstyle.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.DarkTheme);
sellstoplimitstyle.Set(ControlProperty.ForegroundColor, Color.FromHex("#FFFFFF"), ControlState.LightTheme);
sellstoplimitstyle.Set(ControlProperty.Margin, 3);
contentPanel = new StackPanel
{
HorizontalAlignment = OrderHorizontalAlignment,
VerticalAlignment = OrderVerticalAlignment,
Width = 225,
Style = contetstyle
};
var grid = new Grid(33, 3);
grid.Columns[1].SetWidthInPixels(5);
sellstoplimitbutton = new ToggleButton
{
Text = "Stop/Limit",
Style = sellstoplimitstyle
};
grid.AddChild(sellstoplimitbutton, 0, 0);
sellstoplimitbutton.Click += SellSLbutton;
contentPanel.AddChild(grid);
Chart.AddControl(contentPanel);
}
private void SellSLbutton(ToggleButtonEventArgs e)
{
if (sellstoplimitbutton.IsChecked == true)
{
sellSLbool = true;
}
else
{
sellSLbool = false;
}
}
private static Color GetColorWithOpacity(Color baseColor, decimal opacity)
{
var alpha = (int)Math.Round(byte.MaxValue * opacity, MidpointRounding.AwayFromZero);
return Color.FromArgb(alpha, baseColor);
}
}
}
@information about positions during backtesting: 22 Nov 2021, 11:07
How can I get information about my positions during backtesting?
It is not possible in the following way.
var positions = Positions.FindAll("", symbolname);
best regards.
@Please provide the real time commission per lot.: 14 Oct 2021, 11:48
Please provide the real time commission per lot.