Axiom of volatility development.

Discussion in 'Technical Analysis' started by Resto, May 4, 2025.

  1. Resto claims Programmers pay him $200,000 to look at his Algos.

    Resto claims two Buyers of his Systems made over $200,000 in just over a Week

    Resto claims he's interviewed more than 2500 Programmers.

    Resto claims he's better than Jim Simmons.

    Resto is belligerent abusive and obviously Lies.

    [​IMG]
     
  2. Resto

    Resto


    My opinion about your successful traders can be read here https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-46
    characteristics of my trading systems.
    TS "Development of volatility over time"
    Does not require any special knowledge.
    Usage:
    Time frame: special
    Trading instruments:
    Stock market, futures, indices, crypto exchange instruments, etc.
    Efficient for medium-term and long-term trading
    Entry-exit error 2-5 days
    Allows you to actively reduce - increase your position in medium-term and long-term trading.
    can be read here
    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-50
    ----------------------------------------------------------------------------------------------------
    TS "Building a pattern in time"
    Does not require any special knowledge
    Time frame: any
    Trading instruments:
    stock market, futures, indices, crypto exchange instruments, etc.
    Efficient on any time frame
    Entry-exit error: depending on the selected working time frame up to 2 hours.
    -------------------------------------------------------------------------------------------------
    TS "Cyclicity of the trading instrument"
    Does not require any special knowledge
    Time frame: any
    Trading instruments:
    stock market, futures, indices, crypto exchange instruments, etc.
    Efficient on any time frame
    Entry-exit error: depending on the selected working time frame up to 1 hour
    ----------------------------------------------------------------------------------------------
    The combined use of these trading systems allows you to determine entry and exit points when conducting trading operations with an accuracy of up to a minute and know the duration of the market movement at any time interval.
    Each of these systems requires special characteristics of trading terminals.
    For example, the TS "Cyclicity of market movement" will not be able to work in the tradingview.com terminal.
    Even in the most professional premium version for this trading platform, the history depth for a minute chart is only 40,000 bars, and for a minute chart, the history depth for a monthly interval is more than 43,000 bars
    Ninja Trader terminal is not suitable for working with my algorithms at all

    I will repeat once again, I will communicate only with professional programmers, idiots who comment on my posts and pretend to be programmers are of no interest to me

    Gentlemen, in this post I said that I will conduct public trading and any interested programmer can get access to online trading
    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-37
    As you can see, I started trading with $5,000 Thursday at 1:26 AM
    You can see the current account status here
    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-65
    31 626$ this is not a bad result for this period of time

    I suggest you take an interview to gain access to my online trading operations and verify the effectiveness of this trading system.

    Gentlemen, I remind you that if your programmer passes my interview, I will pay you as $70,000. The payment will be made to your crypto wallet in any coin of your choice.

    I recommend looking at the content on this page
    This will be funny

    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-59

    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-62

    https://www.elitetrader.com/et/threads/axiom-of-volatility-development.384397/page-65
     
    Last edited: May 14, 2025 at 2:23 PM
  3. contra

    contra

    this russki still going at it here...
     
  4. demoncore

    demoncore


    This should stop. You're helping him flood the chat. It's his pic, right?
     
  5. Agree. Ignore thread everyone perhaps?
     
    demoncore likes this.
  6. Weirdest photo of the month.

    He reminds me of Joe Pesci in Casino right before they bash him in with baseball bats and bury his body in the corn fields
     
  7. MarkBrown

    MarkBrown

    pay the puppy 50k and he will give you the configuration ranges that you need as inputs to optimize your system that i wrote for you bark bark....


    //{code below}



    ```mql5
    //+------------------------------------------------------------------+
    //| HarmonicPatternsEA.mq5 |
    //| Expert Advisor for Harmonic Patterns in MT5 |
    //| Detects Gartley, Bat, Butterfly, Crab, Cypher, AB=CD |
    //| Credits: Mark Brown |
    //+------------------------------------------------------------------+
    #property copyright "Mark Brown"
    #property link "https://www.markbrown.com"
    #property version "1.00"
    #property strict

    //--- Inputs for Optimization
    input int ZigZagDepth = 12; // ZigZag Depth
    input int ZigZagDeviation = 5; // ZigZag Deviation
    input int ZigZagBackstep = 3; // ZigZag Backstep
    input double FibTolerance = 0.05; // Fibonacci ratio tolerance (e.g., 0.05 = 5%)
    input double LotSize = 0.1; // Lot size
    input int StopLossPoints = 300; // Stop loss in points
    input int TakeProfitPoints = 500; // Take profit in points
    input bool UseTrailingStop = true; // Use trailing stop
    input int TrailingStopPoints = 200; // Trailing stop points
    input bool TradeGartley = true; // Enable Gartley pattern
    input bool TradeBat = true; // Enable Bat pattern
    input bool TradeButterfly = true; // Enable Butterfly pattern
    input bool TradeCrab = true; // Enable Crab pattern
    input bool TradeCypher = true; // Enable Cypher pattern
    input bool TradeABCD = true; // Enable AB=CD pattern

    //--- Global Variables
    double ZZBuffer[];
    int zigZagHandle;
    datetime lastBar;

    //+------------------------------------------------------------------+
    //| Expert initialization function |
    //+------------------------------------------------------------------+
    int OnInit()
    {
    // Initialize ZigZag indicator
    zigZagHandle = iCustom(_Symbol, PERIOD_CURRENT, "ZigZag", ZigZagDepth, ZigZagDeviation, ZigZagBackstep);
    if(zigZagHandle == INVALID_HANDLE)
    {
    Print("Failed to initialize ZigZag indicator");
    return(INIT_FAILED);
    }

    ArraySetAsSeries(ZZBuffer, true);
    return(INIT_SUCCEEDED);
    }

    //+------------------------------------------------------------------+
    //| Expert deinitialization function |
    //+------------------------------------------------------------------+
    void OnDeinit(const int reason)
    {
    IndicatorRelease(zigZagHandle);
    }

    //+------------------------------------------------------------------+
    //| Expert tick function |
    //+------------------------------------------------------------------+
    void OnTick()
    {
    // Check for new bar
    datetime currentBar = iTime(_Symbol, PERIOD_CURRENT, 0);
    if(currentBar == lastBar) return;
    lastBar = currentBar;

    // Copy ZigZag data
    if(CopyBuffer(zigZagHandle, 0, 0, 100, ZZBuffer) <= 0)
    {
    Print("Failed to copy ZigZag buffer");
    return;
    }

    // Find swing points
    double points[5];
    int timePoints[5];
    int count = 0;
    for(int i = 1; i < 100 && count < 5; i++)
    {
    if(ZZBuffer != 0)
    {
    points[count] = ZZBuffer;
    timePoints[count] = i;
    count++;
    }
    }

    // Check for patterns if we have 5 points
    if(count == 5)
    {
    double X = points[4];
    double A = points[3];
    double B = points[2];
    double C = points[1];
    double D = points[0];
    bool isBullish = (D > B); // Bullish if D is above B

    // Detect patterns
    string pattern = "";
    if(TradeGartley && IsGartleyPattern(X, A, B, C, D))
    pattern = "Gartley";
    else if(TradeBat && IsBatPattern(X, A, B, C, D))
    pattern = "Bat";
    else if(TradeButterfly && IsButterflyPattern(X, A, B, C, D))
    pattern = "Butterfly";
    else if(TradeCrab && IsCrabPattern(X, A, B, C, D))
    pattern = "Crab";
    else if(TradeCypher && IsCypherPattern(X, A, B, C, D))
    pattern = "Cypher";
    else if(TradeABCD && IsABCDPattern(X, A, B, C, D))
    pattern = "AB=CD";

    if(pattern != "")
    {
    // Draw pattern
    DrawPattern(pattern, timePoints, points, isBullish);
    // Execute trade
    if(PositionsTotal() == 0) // Only trade if no open positions
    ExecuteTrade(pattern, isBullish, D);
    }
    }

    // Manage trailing stop
    if(UseTrailingStop)
    ManageTrailingStop();
    }

    //+------------------------------------------------------------------+
    //| Pattern detection functions |
    //+------------------------------------------------------------------+
    bool IsGartleyPattern(double X, double A, double B, double C, double D)
    {
    double XA = MathAbs(A - X);
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);
    double AD = MathAbs(D - A);

    double AB_XA = AB / XA;
    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double AD_XA = AD / XA;

    return (AB_XA >= 0.618 - FibTolerance && AB_XA <= 0.618 + FibTolerance &&
    BC_AB >= 0.382 - FibTolerance && BC_AB <= 0.886 + FibTolerance &&
    CD_BC >= 1.272 - FibTolerance && CD_BC <= 1.618 + FibTolerance &&
    AD_XA >= 0.786 - FibTolerance && AD_XA <= 0.786 + FibTolerance);
    }

    bool IsBatPattern(double X, double A, double B, double C, double D)
    {
    double XA = MathAbs(A - X);
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);
    double AD = MathAbs(D - A);

    double AB_XA = AB / XA;
    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double AD_XA = AD / XA;

    return (AB_XA >= 0.382 - FibTolerance && AB_XA <= 0.50 + FibTolerance &&
    BC_AB >= 0.382 - FibTolerance && BC_AB <= 0.886 + FibTolerance &&
    CD_BC >= 1.618 - FibTolerance && CD_BC <= 2.618 + FibTolerance &&
    AD_XA >= 0.886 - FibTolerance && AD_XA <= 0.886 + FibTolerance);
    }

    bool IsButterflyPattern(double X, double A, double B, double C, double D)
    {
    double XA = MathAbs(A - X);
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);
    double AD = MathAbs(D - A);

    double AB_XA = AB / XA;
    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double AD_XA = AD / XA;

    return (AB_XA >= 0.786 - FibTolerance && AB_XA <= 0.786 + FibTolerance &&
    BC_AB >= 0.382 - FibTolerance && BC_AB <= 0.886 + FibTolerance &&
    CD_BC >= 1.618 - FibTolerance && CD_BC <= 2.618 + FibTolerance &&
    AD_XA >= 1.272 - FibTolerance && AD_XA <= 1.618 + FibTolerance);
    }

    bool IsCrabPattern(double X, double A, double B, double C, double D)
    {
    double XA = MathAbs(A - X);
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);
    double AD = MathAbs(D - A);

    double AB_XA = AB / XA;
    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double AD_XA = AD / XA;

    return (AB_XA >= 0.382 - FibTolerance && AB_XA <= 0.618 + FibTolerance &&
    BC_AB >= 0.382 - FibTolerance && BC_AB <= 0.886 + FibTolerance &&
    CD_BC >= 2.24 - FibTolerance && CD_BC <= 3.618 + FibTolerance &&
    AD_XA >= 1.618 - FibTolerance && AD_XA <= 1.618 + FibTolerance);
    }

    bool IsCypherPattern(double X, double A, double B, double C, double D)
    {
    double XA = MathAbs(A - X);
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);
    double AD = MathAbs(D - A);

    double AB_XA = AB / XA;
    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double AD_XA = AD / XA;

    return (AB_XA >= 0.382 - FibTolerance && AB_XA <= 0.618 + FibTolerance &&
    BC_AB >= 1.13 - FibTolerance && BC_AB <= 1.414 + FibTolerance &&
    CD_BC >= 1.272 - FibTolerance && CD_BC <= 2.0 + FibTolerance &&
    AD_XA >= 0.786 - FibTolerance && AD_XA <= 0.786 + FibTolerance);
    }

    bool IsABCDPattern(double X, double A, double B, double C, double D)
    {
    double AB = MathAbs(B - A);
    double BC = MathAbs(C - B);
    double CD = MathAbs(D - C);

    double BC_AB = BC / AB;
    double CD_BC = CD / BC;
    double CD_AB = CD / AB;

    return (BC_AB >= 0.618 - FibTolerance && BC_AB <= 0.786 + FibTolerance &&
    CD_BC >= 1.272 - FibTolerance && CD_BC <= 1.618 + FibTolerance &&
    MathAbs(CD_AB - 1.0) <= FibTolerance); // AB ≈ CD
    }

    //+------------------------------------------------------------------+
    //| Draw pattern on chart |
    //+------------------------------------------------------------------+
    void DrawPattern(string pattern, int &timePoints[], double &points[], bool isBullish)
    {
    string objName = pattern + "_" + TimeToString(TimeCurrent(), TIME_MINUTES);
    ObjectCreate(0, objName, OBJ_FIBO, 0, iTime(_Symbol, PERIOD_CURRENT, timePoints[4]), points[4], iTime(_Symbol, PERIOD_CURRENT, timePoints[0]), points[0]);
    ObjectSetInteger(0, objName, OBJPROP_COLOR, isBullish ? clrBlue : clrRed);
    ObjectSetInteger(0, objName, OBJPROP_STYLE, STYLE_SOLID);
    ObjectSetInteger(0, objName, OBJPROP_WIDTH, 2);
    ObjectSetString(0, objName, OBJPROP_TEXT, pattern + (isBullish ? " Bullish" : " Bearish"));
    }

    //+------------------------------------------------------------------+
    //| Execute trade |
    //+------------------------------------------------------------------+
    void ExecuteTrade(string pattern, bool isBullish, double entryPrice)
    {
    MqlTradeRequest request = {0};
    MqlTradeResult result = {0};

    request.action = TRADE_ACTION_DEAL;
    request.symbol = _Symbol;
    request.volume = LotSize;
    request.type = isBullish ? ORDER_TYPE_BUY : ORDER_TYPE_SELL;
    request.price = entryPrice;
    request.sl = isBullish ? entryPrice - StopLossPoints * _Point : entryPrice + StopLossPoints * _Point;
    request.tp = isBullish ? entryPrice + TakeProfitPoints * _Point : entryPrice - TakeProfitPoints * _Point;
    request.deviation = 10;
    request.magic = 123456;
    request.comment = pattern + " Trade";

    if(!OrderSend(request, result))
    Print("Trade failed: ", GetLastError());
    else
    Print("Trade opened: ", pattern, ", ", isBullish ? "Bullish" : "Bearish", " at ", entryPrice);
    }

    //+------------------------------------------------------------------+
    //| Manage trailing stop |
    //+------------------------------------------------------------------+
    void ManageTrailingStop()
    {
    for(int i = PositionsTotal() - 1; i >= 0; i--)
    {
    ulong ticket = PositionGetTicket(i);
    if(PositionSelectByTicket(ticket))
    {
    double sl = PositionGetDouble(POSITION_SL);
    double tp = PositionGetDouble(POSITION_TP);
    double currentPrice = PositionGetDouble(POSITION_TYPE) == POSITION_TYPE_BUY ? SymbolInfoDouble(_Symbol, SYMBOL_BID) : SymbolInfoDouble(_Symbol, SYMBOL_ASK);
    double entryPrice = PositionGetDouble(POSITION_PRICE_OPEN);

    MqlTradeRequest request = {0};
    MqlTradeResult result = {0};

    if(PositionGetInteger(POSITION_TYPE) == POSITION_TYPE_BUY)
    {
    double newSL = currentPrice - TrailingStopPoints * _Point;
    if(newSL > sl && newSL > entryPrice)
    {
    request.action = TRADE_ACTION_SLTP;
    request.position = ticket;
    request.sl = NormalizeDouble(newSL, _Digits);
    request.tp = tp;
    if(!OrderSend(request, result))
    Print("Trailing stop failed: ", GetLastError());
    }
    }
    else // POSITION_TYPE_SELL
    {
    double newSL = currentPrice + TrailingStopPoints * _Point;
    if(newSL < sl && newSL < entryPrice)
    {
    request.action = TRADE_ACTION_SLTP;
    request.position = ticket;
    request.sl = NormalizeDouble(newSL, _Digits);
    request.tp = tp;
    if(!OrderSend(request, result))
    Print("Trailing stop failed: ", GetLastError());
    }
    }
    }
    }
    }
    ```






    // or tradestation - multicharts code below

    // Gartley Pattern Strategy for MultiCharts/TradeStation
    // Credits: Mark Brown
    // Detects Bullish and Bearish Gartley Patterns and Trades Them
    // No Reversal Logic Included

    [IntrabarOrderGeneration = False];

    Inputs:
    // Pattern Detection Parameters
    LookbackBars(10), // Bars to look back for pivot detection
    FibTolerance(0.05), // Fibonacci ratio tolerance (e.g., 0.05 = 5%)
    MinPivotStrength(3), // Minimum bars to confirm pivot
    // Trading Parameters
    PositionSize(1), // Number of contracts
    StopLossPoints(300), // Stop loss in points
    TakeProfitPoints(500), // Take profit in points
    UseTrailingStop(True), // Enable trailing stop
    TrailingStopPoints(200), // Trailing stop in points
    // Optional Custom Data Fields (from your data)
    Jounce(0), // Custom Jounce value (placeholder)
    MP(0), // Custom Market Position (placeholder)
    BuyFlag(0), // Custom BuyFlag (placeholder)
    // Pattern Enable
    TradeBullishGartley(True), // Enable bullish Gartley trades
    TradeBearishGartley(True); // Enable bearish Gartley trades

    Vars:
    // Swing Points
    X(0), A(0), B(0), C(0), D(0),
    XBar(0), ABar(0), BBar(0), CBar(0), DBar(0),
    // Position and Trade Tracking
    MyPosition(0), // 0: flat, 1: long, -1: short
    EntryPrice(0), // Entry price of current position
    TotalProfit(0), // Cumulative profit
    TradeCount(0), // Number of trades
    LastTradeProfit(0), // Profit from last trade
    // Trailing Stop
    TrailingStopPrice(0),
    // Pattern Detection
    PatternDetected(False),
    IsBullishPattern(False);

    // Function to detect high pivot
    Define Function HighPivot(BarOffset, Strength) : Double;
    Var: i(0), IsPivot(True), PivotPrice(0);
    PivotPrice = High[BarOffset];
    For i = 1 To Strength Begin
    If High[BarOffset + i] >= PivotPrice Or High[BarOffset - i] >= PivotPrice Then
    IsPivot = False;
    End;
    If IsPivot Then
    Return PivotPrice
    Else
    Return 0;
    End;

    // Function to detect low pivot
    Define Function LowPivot(BarOffset, Strength) : Double;
    Var: i(0), IsPivot(True), PivotPrice(0);
    PivotPrice = Low[BarOffset];
    For i = 1 To Strength Begin
    If Low[BarOffset + i] <= PivotPrice Or Low[BarOffset - i] <= PivotPrice Then
    IsPivot = False;
    End;
    If IsPivot Then
    Return PivotPrice
    Else
    Return 0;
    End;

    // Function to check Gartley pattern ratios
    Define Function IsGartleyPattern(X, A, B, C, D, IsBullish) : Bool;
    Var: XA(0), AB(0), BC(0), CD(0), AD(0), AB_XA(0), BC_AB(0), CD_BC(0), AD_XA(0);
    XA = AbsValue(A - X);
    AB = AbsValue(B - A);
    BC = AbsValue(C - B);
    CD = AbsValue(D - C);
    AD = AbsValue(D - A);

    If XA = 0 Or AB = 0 Or BC = 0 Or CD = 0 Then
    Return False;

    AB_XA = AB / XA;
    BC_AB = BC / AB;
    CD_BC = CD / BC;
    AD_XA = AD / XA;

    Return (
    AB_XA >= 0.618 - FibTolerance And AB_XA <= 0.618 + FibTolerance
    And BC_AB >= 0.382 - FibTolerance And BC_AB <= 0.886 + FibTolerance
    And CD_BC >= 1.272 - FibTolerance And CD_BC <= 1.618 + FibTolerance
    And AD_XA >= 0.786 - FibTolerance And AD_XA <= 0.786 + FibTolerance
    And ((IsBullish And D > B) Or (Not IsBullish And D < B))
    );
    End;

    // Main Strategy Logic
    If BarStatus(1) = 2 Then Begin
    // Reset pattern detection
    PatternDetected = False;

    // Find swing points (X, A, B, C, D)
    Var: i(0), PivotCount(0);
    X = 0; A = 0; B = 0; C = 0; D = 0;
    XBar = 0; ABar = 0; BBar = 0; CBar = 0; DBar = 0;

    For i = 0 To LookbackBars - 1 Begin
    If PivotCount < 5 Then Begin
    If HighPivot(i, MinPivotStrength) <> 0 Then Begin
    If PivotCount = 0 Then Begin
    D = HighPivot(i, MinPivotStrength);
    DBar = i;
    End Else If PivotCount = 2 Then Begin
    B = HighPivot(i, MinPivotStrength);
    BBar = i;
    End Else If PivotCount = 4 Then Begin
    X = HighPivot(i, MinPivotStrength);
    XBar = i;
    End;
    PivotCount = PivotCount + 1;
    End Else If LowPivot(i, MinPivotStrength) <> 0 Then Begin
    If PivotCount = 1 Then Begin
    C = LowPivot(i, MinPivotStrength);
    CBar = i;
    End Else If PivotCount = 3 Then Begin
    A = LowPivot(i, MinPivotStrength);
    ABar = i;
    End;
    PivotCount = PivotCount + 1;
    End;
    End;
    End;

    // Check for Gartley pattern
    If PivotCount >= 5 Then Begin
    If TradeBullishGartley And IsGartleyPattern(X, A, B, C, D, True) Then Begin
    PatternDetected = True;
    IsBullishPattern = True;
    Print("Bullish Gartley detected at Bar ", CurrentBar, ", D = ", D);
    End Else If TradeBearishGartley And IsGartleyPattern(X, A, B, C, D, False) Then Begin
    PatternDetected = True;
    IsBullishPattern = False;
    Print("Bearish Gartley detected at Bar ", CurrentBar, ", D = ", D);
    End;
    End;

    // Trading Logic
    If PatternDetected And MyPosition = 0 Then Begin
    If IsBullishPattern Then Begin
    Buy ("GartleyLong") PositionSize Contracts Next Bar At D Limit;
    MyPosition = 1;
    EntryPrice = D;
    TradeCount = TradeCount + 1;
    TrailingStopPrice = D - TrailingStopPoints * MinMove / PriceScale;
    Print("Time: ", Time, ", Buy at ", D);
    End Else Begin
    SellShort ("GartleyShort") PositionSize Contracts Next Bar At D Limit;
    MyPosition = -1;
    EntryPrice = D;
    TradeCount = TradeCount + 1;
    TrailingStopPrice = D + TrailingStopPoints * MinMove / PriceScale;
    Print("Time: ", Time, ", Sell Short at ", D);
    End;
    End;

    // Exit Logic
    If MyPosition = 1 Then Begin
    // Stop Loss
    Sell ("LongStop") PositionSize Contracts Next Bar At EntryPrice - StopLossPoints * MinMove / PriceScale Stop;
    // Take Profit
    Sell ("LongTP") PositionSize Contracts Next Bar At EntryPrice + TakeProfitPoints * MinMove / PriceScale Limit;
    // Trailing Stop
    If UseTrailingStop And High >= TrailingStopPrice + TrailingStopPoints * MinMove / PriceScale Then
    TrailingStopPrice = TrailingStopPrice + TrailingStopPoints * MinMove / PriceScale;
    Sell ("LongTrail") PositionSize Contracts Next Bar At TrailingStopPrice Stop;
    End Else If MyPosition = -1 Then Begin
    // Stop Loss
    BuyToCover ("ShortStop") PositionSize Contracts Next Bar At EntryPrice + StopLossPoints * MinMove / PriceScale Stop;
    // Take Profit
    BuyToCover ("ShortTP") PositionSize Contracts Next Bar At EntryPrice - TakeProfitPoints * MinMove / PriceScale Limit;
    // Trailing Stop
    If UseTrailingStop And Low <= TrailingStopPrice - TrailingStopPoints * MinMove / PriceScale Then
    TrailingStopPrice = TrailingStopPrice - TrailingStopPoints * MinMove / PriceScale;
    BuyToCover ("ShortTrail") PositionSize Contracts Next Bar At TrailingStopPrice Stop;
    End;

    // Position Exit Handling
    If MarketPosition <> MyPosition Then Begin
    If MyPosition = 1 Then Begin
    LastTradeProfit = (Close - EntryPrice) * PositionSize * BigPointValue;
    TotalProfit = TotalProfit + LastTradeProfit;
    Print("Time: ", Time, ", Exit Long at ", Close, ", Profit: ", LastTradeProfit);
    End Else If MyPosition = -1 Then Begin
    LastTradeProfit = (EntryPrice - Close) * PositionSize * BigPointValue;
    TotalProfit = TotalProfit + LastTradeProfit;
    Print("Time: ", Time, ", Exit Short at ", Close, ", Profit: ", LastTradeProfit);
    End;
    MyPosition = 0;
    End;

    // Optional: Use Custom Data Fields
    If BuyFlag = 1 And MyPosition = 0 And PatternDetected And IsBullishPattern Then Begin
    Buy ("BuyFlagLong") PositionSize Contracts Next Bar At Market;
    MyPosition = 1;
    EntryPrice = Close;
    TradeCount = TradeCount + 1;
    TrailingStopPrice = Close - TrailingStopPoints * MinMove / PriceScale;
    Print("Time: ", Time, ", BuyFlag Entry at ", Close);
    End;

    // Plot Pattern Points (for visualization)
    If PatternDetected Then Begin
    Plot1[DBar](D, "PointD", Cyan);
    Plot2[CBar](C, "PointC", Yellow);
    Plot3[BBar](B, "PointB", Magenta);
    Plot4[ABar](A, "PointA", Green);
    Plot5[XBar](X, "PointX", Red);
    End;

    // Output Results
    If LastBarOnChart Then Begin
    Print("Total Trades: ", TradeCount);
    Print("Total Profit: ", TotalProfit);
    End;
    End;




     
    Last edited: May 14, 2025 at 9:41 PM
  8. vztrdr

    vztrdr

    It reminds me of a debaucherous Anderson Cooper after a hard night in Phuket.
     
  9. vztrdr

    vztrdr