S2-B1/B2: live account balance, Optimizable attrs, BarsRequired=50, archive NT8.Core.Orders
Some checks failed
Build and Test / build (push) Has been cancelled
Some checks failed
Build and Test / build (push) Has been cancelled
This commit is contained in:
@@ -178,7 +178,7 @@ namespace NinjaTrader.NinjaScript.Strategies
|
||||
TraceOrders = false;
|
||||
RealtimeErrorHandling = RealtimeErrorHandling.StopCancelClose;
|
||||
StopTargetHandling = StopTargetHandling.PerEntryExecution;
|
||||
BarsRequiredToTrade = 20;
|
||||
BarsRequiredToTrade = 50;
|
||||
|
||||
EnableSDK = true;
|
||||
DailyLossLimit = 1000.0;
|
||||
@@ -531,7 +531,23 @@ namespace NinjaTrader.NinjaScript.Strategies
|
||||
|
||||
private AccountInfo BuildAccountInfo()
|
||||
{
|
||||
var accountInfo = NT8DataConverter.ConvertAccount(100000.0, 250000.0, 0.0, 0.0, DateTime.UtcNow);
|
||||
double cashValue = 100000.0;
|
||||
double buyingPower = 250000.0;
|
||||
|
||||
try
|
||||
{
|
||||
if (Account != null)
|
||||
{
|
||||
cashValue = Account.Get(AccountItem.CashValue, Currency.UsDollar);
|
||||
buyingPower = Account.Get(AccountItem.BuyingPower, Currency.UsDollar);
|
||||
}
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
Print(string.Format("[NT8-SDK] WARNING: Could not read live account balance, using defaults: {0}", ex.Message));
|
||||
}
|
||||
|
||||
var accountInfo = NT8DataConverter.ConvertAccount(cashValue, buyingPower, 0.0, 0.0, DateTime.UtcNow);
|
||||
_lastAccountInfo = accountInfo;
|
||||
return accountInfo;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ namespace NinjaTrader.NinjaScript.Strategies
|
||||
public class SimpleORBNT8 : NT8StrategyBase
|
||||
{
|
||||
[NinjaScriptProperty]
|
||||
[Optimizable]
|
||||
[Display(Name = "Opening Range Minutes", GroupName = "ORB Strategy", Order = 1)]
|
||||
[Range(5, 120)]
|
||||
public int OpeningRangeMinutes { get; set; }
|
||||
@@ -34,11 +35,13 @@ namespace NinjaTrader.NinjaScript.Strategies
|
||||
public double StdDevMultiplier { get; set; }
|
||||
|
||||
[NinjaScriptProperty]
|
||||
[Optimizable]
|
||||
[Display(Name = "Stop Loss Ticks", GroupName = "ORB Risk", Order = 1)]
|
||||
[Range(1, 50)]
|
||||
public int StopTicks { get; set; }
|
||||
|
||||
[NinjaScriptProperty]
|
||||
[Optimizable]
|
||||
[Display(Name = "Profit Target Ticks", GroupName = "ORB Risk", Order = 2)]
|
||||
[Range(1, 100)]
|
||||
public int TargetTicks { get; set; }
|
||||
|
||||
@@ -4,6 +4,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// ARCHIVED: This namespace (NT8.Core.Orders) is superseded by NT8.Core.OMS.
|
||||
// NT8.Core.OMS is the canonical order management implementation used by NT8StrategyBase.
|
||||
// These files are retained for reference only and are not referenced by any active code.
|
||||
// Do not add new code here. Do not remove these files until a full audit confirms zero references.
|
||||
|
||||
namespace NT8.Core.Orders
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -6,6 +6,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
// ARCHIVED: This namespace (NT8.Core.Orders) is superseded by NT8.Core.OMS.
|
||||
// NT8.Core.OMS is the canonical order management implementation used by NT8StrategyBase.
|
||||
// These files are retained for reference only and are not referenced by any active code.
|
||||
// Do not add new code here. Do not remove these files until a full audit confirms zero references.
|
||||
|
||||
namespace NT8.Core.Orders
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
@@ -2,6 +2,11 @@ using NT8.Core.Common.Models;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
// ARCHIVED: This namespace (NT8.Core.Orders) is superseded by NT8.Core.OMS.
|
||||
// NT8.Core.OMS is the canonical order management implementation used by NT8StrategyBase.
|
||||
// These files are retained for reference only and are not referenced by any active code.
|
||||
// Do not add new code here. Do not remove these files until a full audit confirms zero references.
|
||||
|
||||
namespace NT8.Core.Orders
|
||||
{
|
||||
#region Core Order Models
|
||||
|
||||
Reference in New Issue
Block a user