Unable to use DPO in strategy.
Forums › ProRealTime English forum › ProOrder support › Unable to use DPO in strategy.
- This topic has 3 replies, 3 voices, and was last updated 4 years ago by rama.
Tagged: dpo
-
-
04/23/2020 at 8:37 AM #127553scalping12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576//############################//Dumb fellow Indicator//#############################################################c1=MACD[12,26,9](close)once rr=1mb=average[20](typicalprice)k=48n=(k*2)-4p=(n/2)-1h1=DPO[n](high)moyh=high-h1hi=(moyh-moyh[1]+(high[p])/n)*nhi=(round(hi*100))/100l1=dpo[n](low)moyl=low-l1lo=(moyl-moyl[1]+(low[p])/n)*nlo=(round(lo*100))/100clo1=dpo[n](close)moyc=close-clo1clot=(moyc-moyc[1]+(close[p])/n)*nclot=(round(clot*100))/100cond1=(high>high[1] and high>high[2])cond2=(cond1 and high>hi[46]) and (barindex>bari or rr=-1)if cond1 and cond2 thenflagg=1targeth=hightargetl=lo[46]elseflagg=0signa=mbendiffor zz=0 to 45if clot[45-zz]<targetl and hi[45-zz]<=targeth and flagg=1 thensigna=high+(averagetruerange[20](close))*.5rr=1bari=barindex+zz+2breakelsif hi[45-zz]>targeth thensigna=mbbreakendifnextcondi=(low<low[1] and low<low[2]) and low<lo[46] and (barindex>bar or rr=1)if condi thenfflag=1target1=lowtarget2=hi[46]elsefflag=0siigna=mbendiffor kk=0 to 45if clot[45-kk]>target2 and lo[45-kk]>=target1 and fflag=1 thensiigna=low-(averagetruerange[20](close))*.5rr=-1bar=barindex+kk+2breakelsif lo[45-kk]<target1 thensiigna=mbbreakendifnextif barindex < 100 thensigna=undefinedsiigna=undefinedendifgolong = (siigna < mb) and c1>=-5 and rsi[2]<=32goshort = (signa > mb)*-1 and c1<=5 and rsi[2]>=68return golong as "LONG",goshort as "SHORT",0
I am trying to to use the above indicator in program which does not allow to place orders. where as i can trigger an order through alert . Is there any way to replace the word “DPO” with equivalent code?
04/23/2020 at 8:42 AM #127554The DPO indicator repaints itself which is why it always looks so impressive – much like the Zig Zag indicator always looks impressive. Because the returned value is able to change is the reason why it is not possible to use them in auto strategies. Adding code to recreate the DPO will not fix this.
Please try to use more descriptive topic titles rather than just ‘DPO’. I have edited your title to something more meaningful.
04/23/2020 at 9:03 AM #127557You can still use the DPO of past values, which is indeed not as accurate of the one that use future data!!
12345678910// **** DPO of past moving average and not future ones :p = 14avg = average[p](customclose)r = round(p/2) +1b = customclose - avg[r]myDPO = bRETURN myDPO as "Detrented Price Oscillator of past datas", 0 coloured(10,10,255) as "0"04/23/2020 at 1:01 PM #127593This code is giving less accurate results
however I can use my own code through alert. However there is limitation in setting up alter it has to be set up every order and gets disable.
if I want to set up all 20 orders though alert with a interval of 30
say alert triggers with condition1 and condition 2
condition is time>=120000 and time<=1230000
what will be indicator for this
c1= time
return c1 ?
-
AuthorPosts