Applying code only once

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

    How can I adjust the code below to trigger only once;

    // Definition of code parameters
    TIMEFRAME (DAILY)
    // Conditions to enter long positions only once
    IF low <= Average[5](close) then
    BUY 10 CONTRACT AT market
    ENDIF
    #244188 quote
    LucasBest
    Participant
    Average

    once per day or really once ?

    #244189 quote
    efahmy
    Participant
    Average

    once per day

    #244190 quote
    fifi743
    Participant
    Master

    if IntradayBarIndex =0 then
    flag=0
    endif

    // Definition of code parameters
    TIMEFRAME (DAILY)
    // Conditions to enter long positions only once
    IF low <= Average[5](close)and flag=0 then BUY 10 CONTRACT AT market flag=1 ENDIF

    robertogozzi and Iván González thanked this post
    #244191 quote
    efahmy
    Participant
    Average

    is that correct? fifi743

    // Definition of code parameters
    TIMEFRAME (DAILY)
    //////////////////////
    if IntradayBarIndex =0 then
    flag=0
    endif
    //////////////////////
    // Conditions to enter long positions only once
    IF low <= Average[5](close)and flag=0 then 
    BUY 10 CONTRACT AT market 
    flag=1 
    ENDIF
    
    robertogozzi thanked this post
    #244192 quote
    fifi743
    Participant
    Master

    yes that’s it

    #244193 quote
    efahmy
    Participant
    Average

    Many thanks mate

    #244197 quote
    efahmy
    Participant
    Average

    How if I want to do the same strategy buying only once at the Weekly VWAP and Monthly VWAP and buying at any of the lower VWAP bands or selling at any of the upper VWAP bands either daily or weekly or monthly VWAP, I believe it works very well with gold.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

Applying code only once


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
efahmy @efahmy Participant
Summary

This topic contains 7 replies,
has 3 voices, and was last updated by efahmy
11 months, 4 weeks ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 02/22/2025
Status: Active
Attachments: No files
Logo Logo
Loading...