Hej På dig

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #206352 quote
    Patrik JPatrik J
    Participant
    New

    //================================================
    // 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
    }
    }
    }

    #206378 quote
    JSJS
    Participant
    Master
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.
ProRealAI ProRealAI New

Stuck on this ProBuilder code?

Describe what this topic is trying to build, in plain English, and ProRealAI writes the ProRealTime™ indicator, screener or system for you.

Available in 7 languages
Try ProRealAI

Hej På dig


ProBuilder: Indicators & Custom Tools

New Reply
Author
author-avatar
Patrik J @patrik-j Participant
Summary

This topic contains 1 reply,
has 2 voices, and was last updated by JSJS
3 years, 9 months ago.

Topic Details
Forum: ProBuilder: Indicators & Custom Tools
Language: English
Started: 12/27/2022
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...