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!
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?
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.
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