Закрытие нескольких позиций.
[CODE]using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using WealthLab;
using WealthLab.Indicators;
namespace WealthLab.Strategies
{
public class MyStrategy : WealthScript
{
protected override void Execute()
{
SetShareSize(1);
for(int bar = 20; bar < Bars.Count; bar++)
{
//if (IsLastPositionActive)
//if(LastActivePosition!=null)
if(ActivePositions.Count>0)
{
if(bar%12==0)
{
for(int i=ActivePositions.Count-1;i>=0;i--)
SellAtMarket(bar+1, ActivePositions);
}
}
else
{
if(bar%13==0)
{
BuyAtMarket(bar+1);
if(bar%23==0)
{
BuyAtMarket(bar+1);
}
}
}
}
}
}
}[/CODE]