Buying at VWAP bands

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #244607 quote
    efahmy
    Participant
    Average

    Could you please, check this code, I tested it its working but when I Auto it doesn’t

    DEFPARAM CumulateOrders = False
    TIMEFRAME(2 Minute)
    
    //VWAP calculation
    //
    NoSunday = 0            //1=skip Sunday's
    IF (BarIndex = 0) OR (OpenDay <> OpenDay[1]) THEN
    SumVolPrice = 0
    SumVol      = 0
    ENDIF
    IF Volume > 0 THEN
    IF (OpenDayOfWeek <> 0) OR (OpenDayOfWeek = 0 AND Not NoSunday) THEN
    SumVolPrice = SumVolPrice + (Volume * close)
    SumVol      = SumVol      + Volume
    VWAP        = SumVolPrice / SumVol
    ENDIF
    ENDIF
    // VWAP Lower Band 2 (Stronger Deviation)
    VWAPMAIN = VWAP
    VWAPLOWER2 = VWAPMAIN - (3 * STD[20](close))
    
    // Buy condition: Price touches VWAP Lower Band 2
    IF Low <= VWAPLOWER2 THEN
    BUY 10 CONTRACT AT MARKET
    SET TARGET PROFIT 10
    ENDIF
    

     

    work?!

    #244617 quote
    JS
    Participant
    Senior

    Hi,

    What kind of error message do you get when you use the system with autotrading…?

    #244618 quote
    efahmy
    Participant
    Average
    No error, but the condition is meet it does not trigger
    #244619 quote
    JS
    Participant
    Senior

    In what kind of market do you use this system?

    #244620 quote
    efahmy
    Participant
    Average
    Spot gold
    #244621 quote
    GraHal
    Participant
    Master
    Your System (on NAS at M6 TF and with optimised variables) triggered / opened a Long trade for me within 36 mins of starting the Algo … see attached.
    Iván González thanked this post
    Screenshot-2025-03-04-105322.png Screenshot-2025-03-04-105322.png
    #244623 quote
    JS
    Participant
    Senior

    I don’t see anything special about it, backtest is going well, strange…

    Technical support questions under “Help”…

    #244989 quote
    KumoNoJuzza
    Participant
    New
    Hi, @efahmy, are you using VWAP on IG ?
    #244990 quote
    pilou66
    Participant
    Junior
    i get some strange things on IG today… all conditions meet but no order on real. no rejected orders, the bot still running. perhaps you are facing the same problem
    #245148 quote
    efahmy
    Participant
    Average
    Yes
    #245149 quote
    efahmy
    Participant
    Average
    Yes, I’m using it in trading using alerts trading, but failed to use it in Auto trading.
Viewing 11 posts - 1 through 11 (of 11 total)
  • You must be logged in to reply to this topic.

Buying at VWAP bands


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
efahmy @efahmy Participant
Summary

This topic contains 10 replies,
has 5 voices, and was last updated by efahmy
11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 03/04/2025
Status: Active
Attachments: 1 files
Logo Logo
Loading...