Programming help to convert a great code from EasyLanguage?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #57768 quote
    Mags67
    Participant
    Average

    Hi everyone!

    I have a great code here that I like to share with you in ProRealCode, but I cannot translate it. Anyone who can help?

    {Strategy inputs}Inputs: P1 (98),       P2 (22),        myFraction (1.75),       SL(600); {Strategy variables}Vars:   myPOI(0),        myDistance (0),       BO_level (0),       EntryCondLong (false); {Point Of Initiation}myPOI = CloseD(1); //Yesterday ́s daily CLOSE {Distance}myDistance = AvgTrueRange(14) * myFraction; {Entry breakout level – calculates WHERE to enter}BO_level = myPOI + myDistance; {Entry condition – calculates WHEN to enter}EntryCondLong = DMIPlus(P1)<= DMIMinus(P2); {Entry order – enter WHEN and WHERE criteria met}If (MarketPosition = 0 or time = SessionEndTime(0,1)) and EntryCondLong then Buy next bar at BO_levelstop; {Exits – Exit on STOPLOSS or AT THE END OF THE DAY}setstoploss(SL);SetExitOnClose;

    Cheers!

    #57771 quote
    Nicolas
    Keymaster
    Master

    Yes sure, please provide the code as an attached txt file, as the one you posted is hardly readable… Would be much easier to understand it 😉 Thank you.

    Do you know what is the code about? How does it performs and on which instruments/timeframe?

    #57779 quote
    Mags67
    Participant
    Average

    Thank you! It’s been used trading 30min att Russel 2000 (FTSE index) and is essentially a break-out system. Good result although it needs yearly recalibration. Attached txt-file as recommended.

    TScode_180101.txt
    #57783 quote
    Nicolas
    Keymaster
    Master

    Here is the translated code for ProOrder, I don’t get good result on a 30 minutes timeframe, might be the timezone? Is it indented to be traded on Futures? The schedules should be  adapted then.

    defparam cumulateorders=false
    defparam flatbefore=000000
    defparam flatafter=233000
    
    P1=98
    P2=22
    myFraction=1.75
    SL=600
    
    //{Point Of Initiation}
    myPOI = DClose(1) //Yesterday ?s daily CLOSE
    
    //{Distance}
    myDistance = AverageTrueRange[14] * myFraction
    
    //{Entry breakout level - calculates WHERE to enter}
    BOlevel = myPOI + myDistance
    
    //{Entry condition - calculates WHEN to enter}
    EntryCondLong = DIPlus[P1]<= DIMinus[P2]
    
    //{Entry order - enter WHEN and WHERE criteria met}
    If (not onMarket or time=233000) and EntryCondLong then
     Buy 1 contract at BOlevel stop
    endif
    
    //{Exits - Exit on STOPLOSS or AT THE END OF THE DAY}
    set stop ploss SL
Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.

Programming help to convert a great code from EasyLanguage?


ProOrder: Automated Strategies & Backtesting

New Reply
Author
author-avatar
Mags67 @mags67 Participant
Summary

This topic contains 4 replies,
has 2 voices, and was last updated by Nicolas
8 years, 1 month ago.

Topic Details
Forum: ProOrder: Automated Strategies & Backtesting
Language: English
Started: 01/08/2018
Status: Active
Attachments: 2 files
Logo Logo
Loading...