Doji strategy Test
Forums › ProRealTime English forum › ProOrder support › Doji strategy Test
- This topic has 8 replies, 3 voices, and was last updated 2 months ago by robertogozzi.
-
-
08/23/2024 at 1:55 PM #236642Doji strategy1234567891011121314151617181920212223242526272829303132333435363738394041DEFPARAM CumulateOrders = falseTimeframe(Daily,UpdateOnClose)Positionsize=1//C3=TIME=<220000DojiSize = K4 //0.15Doji=(abs(Dopen(1) - Dclose(1)) <= (DHigh(1) - Dlow(1)) * DojiSize)DojiPositionHigh= (Dclose(1)and Dopen(1))>=Dlow(1)+0.666*(DHigh(1) - Dlow(1))DojiPositionLow= (Dclose(1)and Dopen(1))<=Dlow(1)+0.333*(DHigh(1) - Dlow(1))if doji and DojiPositionHigh thenFlag=1elseflag=0endifif doji and DojiPositionLow thenFlag=2elseflag=0endif//DojiPositionMiddleif doji and not DojiPositionHigh and not DojiPositionLow thenFlag=3elseflag=0endifIf not ONMARKET and Flag=K1 then //KK=8Buy positionsize contract at marketEndIf//IF not ONMARKET and Flag=K1 THEN//sellshort positionsize CONTRACT AT market//ENDIFIf longOnMarket AND (BarIndex - TradeIndex) >= K2 ThenSell at MarketEndif//If shortOnMarket AND (BarIndex - TradeIndex) >= K2 Then//exitshort at Market//Endif
goodmorning,
I’m trying to do a strategy for test, that analyse the position of the body in the Doji candle )high, low or middle) but for some reasons it does not give me any results for test. what I’m doing wrong?
Dojisize is range of body, for example with K4 from 0,1 to 0,4. DojiPositionHigh is in the high third of the daily candle and DojiPositionLow is in the low third of the daily candle
thanks in advance
Alessio
08/23/2024 at 1:58 PM #23664308/23/2024 at 2:33 PM #236644Try using GRAPH on all of your conditions, it is likely that one or more are not ever True?
08/23/2024 at 2:43 PM #23664508/23/2024 at 5:04 PM #23665708/23/2024 at 5:18 PM #236662Pick 1 bar and use the actual values of that 1 bar in your calculation for DojiPositionHigh and DojiPositionLow and see if your condition is feasible?
Just ideas as sometimes (working on our own)we feel like we are going bonkers?? 😉
08/23/2024 at 5:26 PM #236663Append these lines at the end of your code to spot any incorrect value:
123graph dojigraph DojiPositionHigh coloured("Blue")graph DojiPositionLow coloured("Red")08/23/2024 at 6:25 PM #23666408/24/2024 at 5:05 PM #236687So you know where the issue is, which makes it a bit easier to work out.
-
AuthorPosts
Find exclusive trading pro-tools on