How to ignore Code?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #11633 quote
    GraHal
    Participant
    Master

    Is there a term I can insert in a line of code so that the code that follows is ‘ignored’ until the next ‘ignore’ is noted?

    Example:

    IF barindex – tradeindex = 55 OR POSITIONPERF < – 0.01 ignore OR POSITIONPERF > 0.051 ignore THEN …

    I know I can ‘comment out’ the expression but I then have to move  the expression to a separate line.

    I want to leave the expression in the line of code run Backtest and then remove the ignore terms and run backtest again.

    Thanks

    GraHal

    #11639 quote
    Elsborgtrading
    Participant
    Veteran

    I don’t know if this will help, but I use a different approach. I use some switches like this so I don’t have to REMove some of the code. When dealing with several different code you want to switch between I find this very fast to do.

    Cheers

    Kasper

    sw1=1
    
    if Sw1=1 then
    barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 
    else
    barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 OR POSITIONPERF > 0.051 
    endif
    GraHal thanked this post
    #27327 quote
    David Somogyi
    Participant
    Average

    Good Morning @Elsborgtrading @GraHal

    In another programming platform I use an instruction ( “Tradedelay = 1”) to indicate that my position must be opened in the next bar / candle / period (according to conditions not fullfiled in the first bar/candle).

    What would be the equivalent function in ProRealTime?, in other words i want to verify certain conditions in the next bar/candle and re-assess so my system can open a position either short or long.

     

    Could i use Openminute? or Open-1 ?

     

    Code:

    DEFPARAM CumulateOrders = False
    
    DEFPARAM FLATBEFORE = 090000
    
    DEFPARAM FLATAFTER = 150000
    
    indicator1 = Average[9](Sthocastic[14](open))
    c1 = (indicator1 > indicator1[1])
    
    indicator2 = SAR[0.03,0.02,0.2]
    c2 = (indicator2 > indicator2[1])
    
    c1ABS = ABS(indicator1 > indicator2[1])
    c2ABS = (indicator2 > indicator2[1])
    
    IF (c1ABS AND c2ABS) THEN
    BUY 1 CONTRACT AT MARKET
    
    ELSIF (C1ABS AND C2ABS)Open-1 THEN
    BUY 1 CONTRACT AT MARKET
    
    ENDIF
    ENDIF

     

    I thank you ind advance as always for your contributions.

     

    Greetings and good trading

    #31830 quote
    GraHal
    Participant
    Master

    Hi David

    I just noticed this, but I’m not clear what you want, sorry?

    You say … i want to verify certain conditions in the next bar/candle and re-assess so my system can open a position either short or long … PRT checks / verifies coded conditions at the end of every bar / candle and then takes a Long or Short at the start of the next bar if conditions were fulfilled in the last bar.

    Hope above helps?

    GraHal

    #31848 quote
    robertogozzi
    Moderator
    Master

    Another option:

    barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 OR POSITIONPERF > 0.051

    may become

    barindex - tradeindex = 55 OR POSITIONPERF < - 0.01 //OR POSITIONPERF > 0.051
    #31863 quote
    GraHal
    Participant
    Master

    Hi Robert

    Yes the option to ‘Comment out code at the end of a line’ came in with Version 10.3 in 2017 (not an option with 10.2).

    Thank you for taking time to help.

    GraHal

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

How to ignore Code?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 5 replies,
has 4 voices, and was last updated by GraHal
8 years, 11 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 08/12/2016
Status: Active
Attachments: No files
Logo Logo
Loading...