OMX30 trading algo OK

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #24409 quote
    Barney
    Participant
    Senior

    Here is an algo that performs well on one day OMX30. A problem only, the strong uptrend it will be great loss. Is there any good filter that can help me?

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    indicator1 = BollingerDown[20](close)
    c1 = (close CROSSES OVER indicator1)
    
    IF c1 THEN
    BUY 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = Average[20](close)
    c2 = (close CROSSES OVER indicator2)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = BollingerUp[20](close)
    c3 = (close CROSSES OVER indicator3)
    
    IF c3 THEN
    SELLSHORT 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator4 = Average[20](close)
    c4 = (close CROSSES UNDER indicator4)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    //
    /
    
    
            
            
        
    #24411 quote
    Joachim Nilsson
    Participant
    Average

    Which time frame?

    #24413 quote
    Barney
    Participant
    Senior

    Daily 🙂

    #24414 quote
    Barney
    Participant
    Senior

    November 2014 to date, I tested. OMX rising sharply in börjag and then get Algon problems, but then make it over 100 percent remaining time to date!

    #24415 quote
    Joachim Nilsson
    Participant
    Average

    I get -100% after a few trades with your code.

    // Definition of code parameters
    DEFPARAM CumulateOrders = False // Cumulating positions deactivated
    
    // Conditions to enter long positions
    indicator1 = BollingerDown[30](close)
    c1 = (close < indicator1)
    
    IF c1 THEN
    BUY 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit long positions
    indicator2 = Average[40](close)
    c2 = (close > indicator2)
    
    IF c2 THEN
    SELL AT MARKET
    ENDIF
    
    // Conditions to enter short positions
    indicator3 = BollingerUp[10](close)
    c3 = (close > indicator3)
    
    IF c3 THEN
    SELLSHORT 2 CONTRACT AT MARKET
    ENDIF
    
    // Conditions to exit short positions
    indicator4 = Average[10](close)
    c4 = (close < indicator4)
    
    IF c4 THEN
    EXITSHORT AT MARKET
    ENDIF
    
    // Stops and targets
    //
    

    But if I change the code to something like this i get better results.

    #24416 quote
    JC_Bywan
    Moderator
    Master

    Hi Barney,

    Usually, we ask forum members who forget or don’t know about it to use the “insert prt code” button, but here I would kindly ask you the opposite: please do not press the “insert prt code” button when only writing normal text. For info, the “insert PRT code” is not something applied to 0% or 100% of the message, you can write text without pressing the button, then in the middle of your message press the button if you need to insert some code, and then write your code.

    Thanks

    #24418 quote
    Joachim Nilsson
    Participant
    Average

    Barney I tested your code again and sometimes prt makes strange things when you copy paste code. Here´s a screenshot whit your code compared with my tweaked one.

    Skärmavbild-2017-02-08-kl.-19.41.05.png Skärmavbild-2017-02-08-kl.-19.41.05.png
    #24421 quote
    Barney
    Participant
    Senior

    Just as it will be for me, too. Do you see the problem in the beginning if you are running in November 2014.

    #24425 quote
    Barney
    Participant
    Senior

    Shit that’s so bad at spelling in English. Run with Google översättning..Hehe

    #24426 quote
    JC_Bywan
    Moderator
    Master

    My apologies, apparently your text style is due to an automatic translator html style, making it look like you pressed “insert PRT code”, but it is possible you didn’t. Then I’d kindly ask you to make lines not too long so that there’s no need for horizontal scroll bar, thanks.

    #24428 quote
    Barney
    Participant
    Senior

    Ok; shorter lines 🙂

    #24429 quote
    Barney
    Participant
    Senior
    #24432 quote
    Barney
    Participant
    Senior

    Strange Joachim.

    Your screenshot did not work by the way!

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

OMX30 trading algo OK


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Barney @rickardktm Participant
Summary

This topic contains 12 replies,
has 3 voices, and was last updated by Barney
9 years ago.

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