Topics
Replies
ahadfirdosi
31 Aug 2022, 11:47
Only Work With Gold
This bot is working just fine now on Gold as I want. But I am still not sure why it is working only with Gold and not other pairs. Can you please let me know why and how to make it work with other pairs as well?
@ahadfirdosi
ahadfirdosi
31 Aug 2022, 11:26
RE:
PanagiotisCharalampous said:
Hi there,
You need to provide more information regarding what is not working. But an obvious issue is that you do not use brackets for your if statement. So the Stop() method is always executed.
Best Regards,
Panagiotis
I appreciate your help. It's working just fine now. I have just put brackets:
protected override void OnTick()
{
//if account equity is more than equity take profit or less than equity stop loss, we close all positions
if (Account.Equity > Account.Balance + Positions.Count || Account.Equity < EquityStopLoss || Account.Equity > EquityTakeProfit)
{
foreach (var position in Positions)
ClosePosition(position);
Stop();
}
}
@ahadfirdosi
ahadfirdosi
30 Aug 2022, 21:15
RE:
PanagiotisCharalampous said:
Hi there,
You can use the Stop() method.
Best Regards,
Panagiotis
& also I don't know why it is working only for Gold and not on any other pair. Can you help me to enable other pairs as well?
@ahadfirdosi
ahadfirdosi
30 Aug 2022, 17:55
RE:
PanagiotisCharalampous said:
Hi there,
You can use the Stop() method.
Best Regards,
Panagiotis
Hi, Thanks for your reply. It is not working. I am just a beginner in coding. Maybe I am doing something wrong. :(
protected override void OnTick()
{
//if account equity is more than equity take profit or less than equity stop loss, we close all positions
if (Account.Equity > EquityTakeProfit || Account.Equity < EquityStopLoss)
foreach (var position in Positions)
ClosePosition(position);
Stop();
}
@ahadfirdosi
ahadfirdosi
01 Sep 2022, 04:30
RE:
Spotware said:
This is not working!!! Please help. How to make it work? Where is the problem?
It just doesn't close the positions. No Errors.
@ahadfirdosi