Hej På dig
- This topic has 1 reply, 2 voices, and was last updated 1 year ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
Forums › ProRealTime English forum › ProBuilder support › Hej På dig
//================================================
// Code: _PRD DAX Combi
// Source: https://artificall.com
// Author: Vivien Schmitt
// Version: 2.5
// Index: DAX
// TF: 10 min
// Notes: v1.1 Momentum only
// v2 Portfolio of multi strategies
// v2.1 Added Trend Following
// v2.2 Added Double Bottom
// v2.3 Added Green Hammer
// v2.4 Added Counter Trend
// v2.5 Tested Day of Week – ignore
// v2.5 Optimised position size logic
//================================================
input int flatBefore = 090000; // Avoid entry opening before this hour
input int flatAfter = 213000; // Close entry at this hour
input bool cumulateOrders = true; // Only one trade at the same time
int momentumPeriods[6] = {10, 20, 50, 100, 300, 800};
// Make sure these variables are reset to zero when not trading
int p1 = 0;
int p2 = 0;
int p3 = 0;
int p4 = 0;
int p5 = 0;
// Risk management
int positionSize = 1;
//===================================== MOMENTUM STRATEGY ================================================
if (p1 < 1) {
// MOMENTUM STRATEGY
// MARKET TREND USING LINEAR REGRESSION
// Set of technical indicators to test
bool cM[6];
for (int i = 0; i < 6; i++) {
cM[i] = momentum[momentumPeriods[i]](close) > 0;
}
// ENTRY POINT
bool conditionMomentumM = cM[0] AND cM[1] AND cM[2] AND NOT cM[3] AND cM[4] AND NOT cM[5];
// MARKET VOLATILITY USING STANDARD DEVIATION
int volatility100MaxM = 50;
int volatility100MinM = 1;
int volatility100M = STD[100](close);
bool conditionMarketVolatilityM = volatility100M < volatility100MaxM AND volatility100M > volatility100MinM;
// OPEN A LONG ENTRY
if (conditionMomentumM AND conditionMarketVolatilityM) {
if (time > flatBefore AND time < flatAfter AND cumulateOrders) {
// Place trade logic here
}
}
}