CanOz
Home runs feel good, but base hits pay bills!
- Joined
- 11 July 2006
- Posts
- 11,543
- Reactions
- 519
Yeah, it's been one of those days, thankfully they don't happen too regularly.
Just out of curiosity, do you set yourself a maximum loss limit for the day? I don't set a hard limit but I do stop trading until I start seeing better price action. I stopped trading the Kospi after the first hour this morning. Sometimes you just know that things don't look right.
2% of my account. But i try and stop trading a little before that so i still have enough to recover if the situation changes. I think it may be the US open tonight that is the catalyst.
What about you Cap, a daily loss limit?
Canoz, I think you have Ninja Trader. Would you mind running this on DAX 5min data please? I have a feeling it's taking a high % of tiny profits with a massive stop (ie. crap system), but not sure.
/*
NinjaTrader Strategy of Strategy 1.41
Generated by StrategyQuant version 3.8.1
Generated at Tue Oct 04 22:51:00 GMT 2016
Tested on dax, M5, 13.01.2006 - 25.02.2008
Spread: 0.5, Slippage: 0.0, Min distance of stop from price: 0.0
*/
#region Using declarations
using System;
using System.ComponentModel;
using System.Diagnostics;
using System.Drawing;
using System.Drawing.Drawing2D;
using System.Xml.Serialization;
using NinjaTrader.Cbi;
using NinjaTrader.Data;
using NinjaTrader.Indicator;
using NinjaTrader.Gui.Chart;
using NinjaTrader.Strategy;
#endregion
namespace NinjaTrader.Strategy
{
/// <summary>
/// Enter the description of your strategy here
/// </summary>
[Description("Enter the description of your strategy here")]
public class Strategy141 : SQManagedStrategy
{
#region Variables
// Wizard generated variables
// User defined variables (add any user defined variables below)
#endregion
/// <summary>
/// This method is used to configure the strategy and is called once before any strategy method is called.
/// </summary>
protected override void Initialize()
{
base.Initialize();
ReplacePendingOrders = false;
ExitOnClose = false;
MinimumPTSL = 2724;
MaximumPTSL = 2724795;
PendingOrderValidOneBar = false;
BarsRequired = 120;
StrictStopPrices = true;
LimitSignalsToRange = false;
TimeRangeFrom = 0800;
TimeRangeTo = 1600;
MaxTradesPerDay = 0; // 0 means unlimited
}
/// <summary>
/// Called on each bar update event (incoming tick)
/// </summary>
protected override void OnBarUpdate()
{
// ------------------------------------------
// STRATEGY MANAGEMENT
// ------------------------------------------
if(Bars.FirstBarOfSession) tradesPerDay = 0;
// Stop/Limit order expiration handling
// Long --------
if(pendingEntryOrder != null && pendingEntryOrder.OrderAction == OrderAction.Buy) {
// Expiration
if(sqGetPendingOrderBars(pendingEntryOrder) >= 23) {
CancelOrder(pendingEntryOrder);
}
}
// Short --------
if(pendingEntryOrder != null && pendingEntryOrder.OrderAction == OrderAction.SellShort) {
// Expiration
if(sqGetPendingOrderBars(pendingEntryOrder) >= 23) {
CancelOrder(pendingEntryOrder);
}
}
// ------------------------------------------
// ENTRY RULES
// ------------------------------------------
tradeEntered = false;
if(sqCheckTimeWithinRange()) {
// Long --------
if(maxTradesPerDay == 0 || tradesPerDay < maxTradesPerDay) {
bool LongEntryCondition = ((sqDayOfWeek(Time[0].DayOfWeek) != 4 ) && ((Minute < 11) && (sqATR(66, 0) < sqATR(69, 0))));
if(LongEntryCondition == true) {
double price = roundPrice(Open[14] + (0.6) * (sqBarRange(99-1)));
sqEnterLongStop(price);
}
}
// Short --------
if(maxTradesPerDay == 0 || tradesPerDay < maxTradesPerDay) {
bool ShortEntryCondition = ((sqDayOfWeek(Time[0].DayOfWeek) != 4 ) && ((Minute < 11) && (sqATR(66, 0) > sqATR(69, 0))));
if(ShortEntryCondition == true) {
double price = roundPrice(Open[14] + (-0.6) * (sqBarRange(99-1)));
sqEnterShortStop(price);
}
}
}
}
override protected void sqDefineStopLoss(int direction) {
stopLoss.type = CalculationMode.Ticks;
if(direction == 1) {
// long
stopLoss.value = 0;
} else {
// short
stopLoss.value = 0;
}
}
override protected void sqDefineProfitTarget(int direction) {
profitTarget.type = CalculationMode.Ticks;
if(direction == 1) {
// long
profitTarget.value = _round((0.93 * sqATR(97, 0)) / TickSize, 0);
} else {
// short
profitTarget.value = _round((0.93 * sqATR(97, 0)) / TickSize, 0);
}
}
#region Properties
#endregion
}
}
I don't have a clue how to import thecode into NT7 GB. If you can find out that'd be great. I think it needs to be zipped and saved as an NT Strat...edit, tried using notepad and save as a Cs file then zipped it....got an error
Just to show how far this Trump fueled Santa rally has come.....The pullback will be sharp and swift as a NYE hangover!
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?
We use cookies and similar technologies for the following purposes:
Do you accept cookies and these technologies?