max e min strategy

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22963 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran

    Hi,

    I create e very simple code in order to trade a the end of day if the max e min of the day  exceeded the first candle of the last 10 minutes. I suppose to use a time frame o 5 minute in wall street cash (1530 cet time until 22:00 cet time). The system in back don’t trade and I don’t find the mistake. Can you hel me ? Thanks Emanuele

    DEFPARAM CumulateOrders = false
    
    
    DEFPARAM FlatAfter =220000
    
    
    OraLimite = 215000
    
    Orainizio = 215900
    
    n=1
    
    
    IF TIME=215000 THEN
    CashHighMo = Highest[76](high)
    CashLowMo = Lowest[76](low)
    endif
    
    if Time >= Orainizio and time <= Oralimite then
    
    if not onmarket then
    
    c1 = open > CashHighMo
    c2= open < CashLowMo
    
    
    IF c1 THEN
    buy n contract at market
    endif
    
    IF c2 THEN
    sellshort n contract at market
    endif
    
    endif
    endif
    
    SET STOP ptrailing 10
    
    #22973 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran

    Hi,

     

    I change the code after having see the video on you tube but I don’t solve the problem. Why  ? Thanks

    DEFPARAM CumulateOrders = false
    
    
    DEFPARAM FlatAfter =220000
    
    
    OraLimite = 215000
    
    Orainizio = 215900
    
    n=1
    
    condition = time > 153000 and time < 215000
    
    
    if condition then
    Maxprice = max(Maxprice, high)
    Minprice = min(Minprice, low)
    endif
    
    if Time >= Orainizio and time <= Oralimite then
    
    if not onmarket then
    
    c1 = close > Maxprice
    c2= Close < Minprice
    
    
    IF c1 THEN
    buy n contract at market
    endif
    
    IF c2 THEN
    sellshort n contract at market
    endif
    
    endif
    endif
    
    SET STOP ptrailing 10
    
    #22998 quote
    Joachim NilssonJoachim Nilsson
    Participant
    Average

    I think it has to do with this piece of code. You don´t define maxprice and minprice if you have them on both side of the =.

    if condition then
    Maxprice = max(Maxprice, high)
    Minprice = min(Minprice, low)
    endif
    
    #23000 quote
    Joachim NilssonJoachim Nilsson
    Participant
    Average

    Something like this?

    DEFPARAM CumulateOrders = false
    
    
    DEFPARAM FlatAfter =220000
    
    
    OraLimite = 215000
    
    Orainizio = 215900
    
    n=1
    
    if Time >= oralimite and time <= Orainizio then
    
    c1= open < close-2
    c2= open > close-2
    
    
    
    if not onmarket then
    
    
    
    
    IF c1 THEN
    buy n contract at market
    endif
    
    IF c2 THEN
    sellshort n contract at market
    endif
    
    endif
    endif
    
    
    SET STOP ptrailing 10
    #23005 quote
    volpiemanuelevolpiemanuele
    Participant
    Veteran

    Hi,

    Thanks but I want to have max e min of a certain range time of the day. In these manner that you have suggested to me  I don’t have max e min. Thanks

Viewing 5 posts - 1 through 5 (of 5 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

max e min strategy


ProOrder: Automated Strategies & Backtesting

New Reply
Author
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by volpiemanuelevolpiemanuele
9 years, 8 months ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/29/2017
Status: Active
Attachments: No files
ProRealCode ProRealCode
Loading...