I should have realised the feature wasn't working when I closed the position manually on Friday - blame The Flatulent Beauty And Her Sodding Beast.Vokin » Tue Oct 23, 2018 8:49 am wrote:Hi,
i have this problem:
Setting
-- All trades belong to a single basket --
TreatAllPairsAsBasket = true
BasketTargetCash = 50
Now the cash is higher than the set, but the basket is not closed.
Problem as always with my old eyes?
Thanks for answer.
None of the global basket stuff is working in 1k because I forgot to add the code that holds the totals - fixed in 1l.
Easy fix for the DIYers. Do a search for "CashUpl = 0;//For keeping track of the cash cash Upl of multi-trade/hedged positions" and insert this underneath:
Code: Select all
//Global basket trading
TotalPipsUpl = 0;//Global pips total
TotalCashUpl = 0;//Global cash total
Insert this code block underneath:
Code: Select all
//Global basket trading
if (TreatAllPairsAsBasket)
{
TotalCashUpl+= OrderProfit() + OrderSwap() + OrderCommission();
pips = CalculateTradeProfitInPips(OrderType());
TotalPipsUpl+= pips;
}//if (TreatAllPairsAsBasket)