[ protra-Feature Requests-10498 ] 乱数を発生する関数を実装して欲しい

Back to archive index

Sourceforge Tracker Monitor norep****@sourc*****
2007年 5月 30日 (水) 11:59:28 JST


Feature Requests item #10498, was opened at 2007-05-30 10:27
You can respond by visiting: 
https://sourceforge.jp/tracker/?func=detail&atid=3143&aid=10498&group_id=816

Category: None
Group: None
Status: Open
Priority: 5
Submitted By:  (None)
Assigned to:  (None)
Summary: 乱数を発生する関数を実装して欲しい

Initial Comment:
t_sugaです。

指値に対する約定の仕方を制御するのに
使おうと考えています。
?スリッページの発生にも使える。
?ロングの通常指値の場合、
 翌日の始値より高く指値があれば始値で約定
 翌日の始値と安値の間にあれば指値で約定
 安値より下なら約定しない。

これにより、
実際の売買シミュレーションに
近づくと思うのですが。

----------------------------------------------------------------------

Comment By:  (None)
Date: 2007-05-30 11:59

Message:
Logged In: NO 

t_sugaです。

以下のように作って、動作はしているようです。
何しろ、C#は良く分からないので
まずい箇所がありましたら、
修正を箇所を指摘してください。
お願いいたします。


hash.Add(new FunctionType("Rnd", 1), new 
DelegateExecuter.Delegate(Random));


/// <summary>
/// 乱数を取得します。
/// </summary>
/// <param name="args">引数の配列</param>
/// <param name="at">@作用素の値</param>
/// <returns>乱数です。</returns>
private Value Random(Value[] args, int at)
{
int seed = (int)args[0].InnerValue;

Random hRandom = new System.Random();

int iResult = hRandom.Next(seed);

try
{
return new Value(iResult);
}
catch (IndexOutOfRangeException)
{
return null;
}
}


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.jp/tracker/?func=detail&atid=3143&aid=10498&group_id=816




Protra-trackers メーリングリストの案内
Back to archive index