max e min strategy

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #22963 quote
    volpiemanuele
    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
    volpiemanuele
    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 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 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
    volpiemanuele
    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.

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 volpiemanuele
9 years, 1 month ago.

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