Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.
alex_laxya
Members-
Content Count
61 -
Joined
-
Last visited
Content Type
Profiles
Forums
Calendar
Articles
Everything posted by alex_laxya
-
Logical Error in the Strategy Based on Open Types
alex_laxya replied to alex_laxya's topic in Coding Forum
Well, finally solved the riddle. As you guys suggested I go through step by step and add one condition at a time. System is working fine. When now I turn back and look at final strategy I can't help but think that It has become helluva complicated system. The main issue of generating intraday signals using date<>date[1] has been solved by this logic date<> date[1] then begin numberofbars = numberofbars +1 ; if numberofbars > waittime/ barinterval then begin ( waittime is input value of 60 and barinterval is 30 so num of bars to wait are 60/30 = 2 ) Attached the .pla code to demonstrate the logic flow ( code wont work for others as functions for VAH,VAL, AND POC are not disclosed, as this thread is only about logical error in coding ) Thanks again Tams and Smith for kind support and patience. _mpsystem.rar -
Logical Error in the Strategy Based on Open Types
alex_laxya replied to alex_laxya's topic in Coding Forum
Thanks a lot Tams and Smith for your time. I don't have access to the s&p, emini or microsoft scrips on MC. I use NT for it, sorry for that, if possible you please send me the text file Smith so I could import it in to my MC. Today was holiday for Indian markets so all day was busy in coding and simplifying it as Tams had suggested. ( even downloaded Mind Manager s/w for thought tree drawings to make a template. ) So far able to resolve flew glitches and few remains. You are absolutely right Smith, I have already removed Market Profile part for the sake of simplicity and code one step at a time, I would test it and afterwords add other conditions. Will get back in a while with refined and much simpler code. -
Logical Error in the Strategy Based on Open Types
alex_laxya replied to alex_laxya's topic in Coding Forum
Thanks Smith for the advice. The logic is Buy the break out of opening range. Time frame for opening range is one hour. After one hour fifteen minute if Opening Range has not been broken then strategy would look for break out of highest high of last 4 bars ( time frame is 15 min through out the chart ) provided the open type is either open drive, open rejection reverse up or open test drive up ( Market profile logic, I have already coded those open types and those codes give signal within first half hour, then it stop calculating, this part has no issues ) I have already posted the code for open drive in first post ( OD = Open Drive ) Attached the sample data with this post. psudo Code is // code for open drive time > 0900 and time < 0930 then begin type of open = Open drive end; //opening range break out if time > 1000 and time < 1015 then begin if high > opening range then buy next bar at market; end; if marketposition = 0 then begin high > highest ( high,5)[1] and open type is open drive end; setexitonclose; This is the intra day strategy and problem is if I start the code as date <> date[1] or time < time[1] then MC gives error. That is the major obstacle for me and I can't figure it out why is this happening. data for test.txt -
Historical MP Day Types and Open Types?
alex_laxya replied to PointHarvester's topic in Market Profile
I am also working on the same concept. I have coded few open types but those codes I found are little rough especially those types where we need to see previous support/resistance areas. EX. Open Test Drive, here market test previous support to check if there is any buying interest remain and afterwords it goes up. Now to see what was the support area previous day is challenging to code. So I have just added today's opening price action. Here is an example for open drive inputs:timeopen(0945); vars:od(0); od = (h-l)*4/5 ; condition1 = (h-l) >= ((o - l) + od) and time<= timeopen; condition2 = close>open and (h-l)> average((h-l),10); condition3 = low> low[1] + ((h[1]-l[1])/2) and c >c[1]; if condition1 and condition2 and condition3 then value1 = text_new ( date, time, open, "OD"); It's coded in MC. When you apply on the chart and open drive conditions are true then Text will print below the bar ( Text : OD ) See if the logic is correct, would post other codes for other open types. While going through statistical details about type of open and market trend I have found market takes at least 2 hour to establish which type of open is it. If we tried to make assumptions based on first half an hour then it is not that accurate ( Theory says first half or 1 hr ) -
vars: PriceBin(.50), TimeBin(0), Unit4Accum(0), TypAccum(0), BegTime1(0), BegTime2(0), BegTime3(0), DoHoriz(True), Perc4VA(70), LineSize(1); {Begin Comment Out for Signal} vars: PointRight(True),{If set false then display will point to left } Smooth(00), {Angle adjustment for VA projection--range -2>+2 } BegDate(0);{Date on which to start analysis. 0=All } {this is used to limit the number of analyses that are } {made and may be necessary -- particularly in TS7/8... } {to keep "infinite loop" error from occurring. } {must replace Vars: with in the word INPUT: here for an indicator} vars: OnlyLast(true), {Annotate last caclulated values ONLY--AnotHLCP=True also} AnotHLCP(true), {Annotate the VAHigh, VALow, and CP values on chart } OnlyHist(false), {Do not make MP for current day until next day. } DoChan(False), {Draw a channel from VA extremes to next set of extremes } PlotOpen(True); {Plot open of current analysis -- green dotted line } Vars: OpenOfDay(0), Is24Hour(Sess1EndTime<=Un ionSess1StartTime), LowBox(0), DateKnt(0), HKnt(0), ATR21(AvgTrueRange(21)), Bin4Price(Iff(PriceBin>AT R21/20,ATR21/20,Iff(PriceBin<ATR21/50,ATR21/50,PriceBin))), LowValue(LowBox*Bin4Price ), IPass(0), Bin4Time(AbsValue(IntPort ion(TimeBin))), ShiftIt((AbsValue(TimeBin )-Bin4Time)*100), HighValue(H),TotalKnt(0), HoldBar(CurrentBar), HoldAdd(0), OldHoldBar(0), KeepBar(0); Vars: TimeBeg1(Iff(BegTime1<25, IntPortion(BegTime1)*100+ FracPortion(BegTime1)*60, BegTime1)), TimeBeg2(Iff(BegTime2<25, IntPortion(BegTime2)*100+ FracPortion(BegTime2)*60, BegTime2)), TimeBeg3(Iff(BegTime3<25, IntPortion(BegTime3)*100+ FracPortion(BegTime3)*60, BegTime3)); Vars: VAHigh(0), VALow(0), MaxValue(0), MaxIndex(0), SumValue(0); Vars: VAHighValue(h), VALowValue(l),VAPivot(c), VAPerc(Iff(Perc4VA>0,Perc 4VA/100,.7)), CurrentMin(TimeToMinutes( time)), EntryP(0); Vars: VAHighOld(0), VAHighNew(0), VALowOld(0), VALowNew(0), VABarOld(0), VABarNew(0), VADateOld(0), VADateNew(0), VATimeOld(0), VATimeNew(0), DnCount(0), UpCount(0), LBOC(FALSE), NewDate(0), HandlHi(-1), HandlLo(-1), HandlCP(-1), CanBuy(false),CanSell(fal se),DoInit(True); {Begin comment out for Indicator Vars: LossMaxPts(LossMax/BigPointValue), TakProfPts(TakProf/BigPointValue); End comment out for Indicator} Vars: ATR21Val(0), MP(0), StopHH(0), StopLL(0), EnterBar(0), MaxCont(0), NCont(0), HoldDate(Date-1); Vars: PDPtrn(0); Vars: MaxKnt(15000), Direct(0), DoKnt(0); Arrays: PriceKnt[15000](0), HoldKnt[15000](0), Handl[15000](0); If DoInit then begin DoInit=False; Value1=AvgTrueRange(21)/10; If PriceBin=0 then Bin4Price=Value1 else Bin4Price=PriceBin; LowBox = Round(L/Bin4Price,0); End; LBOC = LastBarOnChart; If Date<>Date[1] and TimeBin=0 then NewDate=Date; {For system remove I_} If MP<>MP[1] then begin EntryP=O; EnterBar=CurrentBar; StopHH=H; StopLL=L; End; If Date>=BegDate then begin If (TimeBin>0 and Unit4Accum>0) then begin Condition1=false; Condition3=false; If Unit4Accum=1 then If Date[shiftIt]<>Date[shiftIt+1] then DoKnt=DoKnt+1; If Unit4Accum=2 then If DayOfWeek(date[shiftIt])<DayOfWeek(Date[shiftIt+1]) then DoKnt=DoKnt+1; If Unit4Accum=3 then If Month(Date) <>Month(Date[1]) then DoKnt=DoKnt+1; If Unit4Accum=4 then begin For Value1 = 0 to 3 begin Value2=Value1*3+1; If Month(Date)=Value2 and Month(Date[1])<>Value2 then DoKnt=DoKnt+1; End; End; If Unit4Accum=5 then begin DoKnt=0; Value0=AbsValue(IntPortio n(Direct)); If Sign(Direct)<>Sign(Direct[1]) or LBOC then begin Condition1=True; Condition3=Condition1; If Direct[1]=0 then begin HoldBar=CurrentBar-Value0; HoldAdd=HoldBar-OldHoldBar; End Else begin If LBOC and Sign(Direct)=Sign(Direct[1]) then begin If LBOC[1]=FALSE THEN OldHoldBar=HoldBar; HoldBar=CurrentBar; Value0=0; End Else begin OldHoldBar=HoldBar; HoldBar=CurrentBar-Value0; End; Value2=Highest(H[Value0],HoldBar-OldHoldBar+1); Value3=Lowest (L[Value0],HoldBar-OldHoldBar+1); LowBox =Round(Value3/Bin4Price,0); TotalKnt=Round(Value2/Bin4Price,0)-LowBox; LowValue=LowBox*Bin4Price ; HoldAdd=HoldBar-OldHoldBar; LowBox =0; While TotalKnt<8 begin Bin4Price=Bin4Price/2; LowBox =Round(Value3/Bin4Price,0); TotalKnt=Round(Value2/Bin4Price,0)-LowBox; LowValue=LowBox*Bin4Price ; LowBox =0; End; For Value1 = LowBox to TotalKnt begin Value3=Value1 * Bin4Price + LowValue; PriceKnt[Value1]=0; For Value4 = CurrentBar-HoldBar to CurrentBar-OldHoldBar+1 begin If Value3<=H[Value4] and Value3>=L[Value4] then PriceKnt[Value1]=PriceKnt[Value1]+1; End; End; End; End; End; If DoKnt>=TimeBin then begin Condition1=True; Condition3=Condition1; DoKnt=0; End; End Else begin Condition1=false; Condition3=false; If TimeBin>0 then begin If TimeBeg1=0 then CurrentMin=TimeToMinutes( time)-TimeToMinutes(Sess1FirstB arTime) else CurrentMin=TimeToMinutes( time)-TimeToMinutes(TimeBeg1); If CurrentMin<0 then CurrentMin=CurrentMin+Tim eToMinutes(2359)+1; If CurrentMin<0 then CurrentMin=CurrentMin+24* 60; Condition1=Mod(CurrentMin ,TimeBin)<Mod(CurrentMin[1],TimeBin); Condition3=Condition1; End Else begin If TimeBin<0 then begin If ShiftIt>Bin4Time then ShiftIt=Mod(ShiftIt,Bin4T ime); Condition1=Mod(CurrentBar-ShiftIt,Bin4Time)=0; Condition3=Condition1; End Else begin If DataCompression>1 then begin If ShiftIt>13 then ShiftIt=0; Condition1=Mod(CurrentBar-ShiftIt,13)=0; Condition3=Condition1; End Else Begin Condition9=(Date<>Date[1] and Is24Hour=False) or (Is24Hour and Time>=Sess1StartTime and Time[1]<=Sess1EndTime); If TimeBeg1>0 then if Time>=TimeBeg1 and (Time[1]<TimeBeg1 or Condition9) and TimeBin=0 then Condition1=True; If TimeBeg2>0 then if Time>=TimeBeg2 and Time[1]<TimeBeg2 and TimeBin=0 then Condition1=True; If TimeBeg3>0 then if Time>=TimeBeg3 and Time[1]<TimeBeg3 and TimeBin=0 then Condition1=True; If TimeBeg1=0 then if TimeBin=0 and Condition9 or (LBOC and time>=Addtime(Sess1EndTim e,-5)) then Condition1=True; Condition3=Condition1; End; End; End; End; If LBOC=True and CurrentBar<>KeepBar and (OnlyHist=False or Time=Sess1EndTime) or TimeBin>9998 then Condition1=True; If Condition1 then begin If Condition1 or CurrentBar=1 then begin CanBuy=True; CanSell=True; DateKnt=DateKnt+1; If LBOC=False or Condition3 then OpenOfDay=Open; End; If LBOC=True and LBOC[1]=False and Unit4Accum<>5 then begin Value3=Round(Low/Bin4Price,0); If Value3<LowBox and Value3<>0 then begin Value2=LowBox-Value3; For Value1= 2000-Value2 downto 0 begin PriceKnt[Value1+Value2]=PriceKnt[Value1]; PriceKnt[Value1]=0; End; LowBox =Value3; LowValue=LowBox*Bin4Price ; TotalKnt=TotalKnt+Value2; End; Value2=Round(Low/Bin4Price,0) -LowBox; Value3=Round(High/Bin4Price,0) -LowBox; For Value1=Value2 to Value3 begin PriceKnt[Value1]=PriceKnt[Value1]+1; End; If Value3>TotalKnt then TotalKnt=Value3; End; If TotalKnt>1 and DateKnt>1 then begin MaxValue=-99999; SumValue=0; {Find the max value and sum up the price occupancies} Value99=0; For Value1=0 to TotalKnt begin Value4=PriceKnt[Value1]; If Value4>0 then Value99=Value1; SumValue=SumValue+Value4; If Value4>=MaxValue then begin MaxIndex=Value1; MaxValue=Value4; End; End; {Find all alike and setup CP at middle} Value2=0; For Value1=0 to TotalKnt begin If PriceKnt[Value1]=MaxValue then Value2=Value2+1; End; If Value2>1 then MaxIndex=MaxIndex-IntPortion(Value2/2); {Now find the Value Area (70% of total counts)} VAHigh=MaxIndex; VALow =MaxIndex; Value9=PriceKnt[MaxIndex]; Value10=0; While Value9<=IntPortion(SumVal ue*VAPerc) begin Value10=Value10+1; If MaxIndex-Value10>=0 and Value9<=IntPortion(SumVal ue*VAPerc) then begin VALow =MaxIndex-Value10; Value9=Value9+PriceKnt[VALow]; End; If Value10+MaxIndex<=Value99 and Value9<=IntPortion(SumVal ue*VAPerc) then begin VAHigh=MaxIndex+Value10; Value9=Value9+PriceKnt[VAHigh]; End; End; VAHighValue=LowValue+VAHi gh *Bin4Price; VALowValue =LowValue+VALow *Bin4Price; VAPivot =LowValue+MaxIndex*Bin4Pr ice; Value1=0; VAHighOld=VAHighNew; VAHighNew=VAHighValue[Value1]; VALowOld=VALowNew; VALowNew=VALowValue[Value1]; VADateOld=VADateNew; VADateNew=Date[Value1]; VATimeOld=VATimeNew; VATimeNew=Time[Value1]; VABarOld=VABarNew; VABarNew=CurrentBar; If TotalKnt>0 then PDPtrn=MaxIndex/TotalKnt else PDPtrn=0; PDPtrn=Round(PDPtrn*4,0); If DateKnt>2 then begin Value2=LowValue; If PointRight then Value6=CurrentBar-HoldBar+HoldAdd else Value6=HoldAdd; {Now plot the data and highlight VA} If DateKnt>3 then begin If LBOC then begin for Value1=0 to TotalKnt begin If Handl[Value1]<>0 then begin TL_Delete(Handl[Value1]); Handl[Value1]=0; End; End; End; HKnt=0; For Value1=0 to TotalKnt begin Value4=PriceKnt[Value1]; If PointRight then If HoldBar-HoldAdd+Value4>CurrentBar then Value4=Value6; If Value4>0 and Value5<MaxKnt then begin If DoHoriz then begin {Value2=(LowBox+Value1)*B in4Price;} If PointRight Then Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6-Value4],time[Value6-Value4],Value2) Else Value5=TL_New(date[Value6],time[Value6],Value2,date[Value6+Value4],time[Value6+Value4],Value2); Value7=Blue; If LBOC then Handl[Value1]=Value5; If Value1<VALow then value7=red; If Value1>VAHigh then value7=yellow; If Value1=MaxIndex then value7=Red; Value7=TL_SetAll(Value5, Value7, LineSize, 3, False, false); End; If AnotHLCP then begin If (OnlyLast and LBOC) or (OnlyLast=False) or (OnlyHIst) then begin If PointRight then Value30=-Value4 else Value30=0; If Value1=VALow then begin If HandlLo>=0 then Text_Delete(HandlLo); HandlLo=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )); Text_SetStyle(HandlLo,0,2 ); End; If Value1=VAHigh then begin If HandlHi>=0 then Text_Delete(HandlHi); HandlHi=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )); Text_SetStyle(HandlHi,0,2 ); End; If Value1=MaxIndex then begin If HandlCP>=0 then Text_Delete(HandlCP); HandlCP=Text_New(date[Value6+Value30],time[Value6+Value30],Value2,NumToStr(Value2,2 )+"--"+NumToStr(PDPtrn,0)) ; Text_SetStyle(HandlCP,0,2 ); End; End; End; End; Value2=Value2+Bin4Price; End; If DoChan and Value5<4500 then begin Value3=TL_NEW(VADateOld,V ATimeOld,VAHighOld,VADate New,VATimeNew,VAHighNew); Value4=TL_NEW(VADateOld,V ATimeOld,VALowOld, VADateNew,VATimeNew,VALow New); Value7=TL_SetAll(Value3, blue, LineSize, 3, False, false); Value7=TL_SetAll(Value4, red , LineSize, 3, False, false); End; End; Condition5=True; If TimeBin<>0 then begin If (TypAccum>210000 and Date[1]=TypAccum) then Condition5=False; If (TypAccum=-2 and Date[1]=CurrentDate) then Condition5=False; If (TypAccum=-1 and Time<>Sess1StartTime+BarI nterval) then Condition5=False; End; If LBOC=False then begin If Condition5 then begin For Value1=0 to 2000 begin PriceKnt[Value1]=0; End; TotalKnt=0; LowBox =Round(Low/Bin4Price,0); LowValue=LowBox*Bin4Price ; End; If Unit4Accum<>5 then HoldBar =CurrentBar; IPASS=Time; End; End; End; If LBOC then KeepBar=CurrentBar; End; If DateKnt>1 then begin If DateKnt>3 and VAHighValue<>0 and VALowValue<>0 then begin If Smooth=0 then begin Value17=VAHighNew; Value18=VALowNew; End Else begin If Condition1 then begin Value15=(VAHighNew-VAHighOld+VALowNew-VALowOld)*0.5/(VABarNew-VABarOld); Value19=.5/(VABarNew-VABarOld); End; Value14=(CurrentBar-VABarNew); Value16=Value15*Value14*S mooth*(1-Value14*Value19); Value17=VAHighNew+Value16 ; Value18=VALowNew +Value16; End; {Remove right brace for SIGNAL -- add for INDICATOR} If LBOC then begin Value2=-MaxBarsForward; Value3=-1; {If KeepBar=0 then OpenOfDay=C;} If Smooth=0 then begin End; End else begin Value27=Value17; Value28=Value18; Value29=VAPivot; Value2=0; Value3=0; If Unit4Accum=5 then Value3=Value6; End; End; If HandlHi>-1 then begin Text_SetLocation(HandlHi, Date,Time,Value17); Text_SetLocation(HandlCP, Date,Time,VAPivot{Value29 }); Text_SetLocation(HandlLo, Date,Time,Value18); End; End; End; If Condition3 and (OnlyLast=False) then begin HandlHi=(-1); HandlLo=(-1); HandlCP=(-1); End; If DateKnt>1 and (LBOC=False or LBOC[1]=True) then begin Value3=Round(Low/Bin4Price,0); If Value3<LowBox and Value3<>0 then begin Value2=LowBox-Value3; For Value1= 2000-Value2 downto 0 begin PriceKnt[Value1+Value2]=PriceKnt[Value1]; PriceKnt[Value1]=0; End; LowBox =Value3; LowValue=LowBox*Bin4Price ; TotalKnt=TotalKnt+Value2; End; Value2=Round(Low/Bin4Price,0) -LowBox; Value3=Round(High/Bin4Price,0) -LowBox; For Value1=Value2 to Value3 begin PriceKnt[Value1]=PriceKnt[Value1]+1; End; If Value3>TotalKnt then TotalKnt=Value3; End; {end date loop} poc=vapivot;
-
Logical Error in the Strategy Based on Open Types
alex_laxya replied to alex_laxya's topic in Coding Forum
Thanks Tams for the advice.. Well I fragmented the ideas step by step and also tried to print the signals from MC to text file. Here I found something problematic. I was trying to debug the code one structure at a time, and seems like problem lies in time< time[1] ( or date<> date[1] ) line. Here is an experiment.. Run this code without time<time[1] ( or date<> date[1] ) vars: highesthi(0); if time>0900 and time<1500 {and date<>date[1]} then begin highesthi = highest(high[1],5); if high>highesthi then buy next bar at market; end; setexitonclose; you will get accurate signals now add time>time[1] or date<>date[1] vars: highesthi(0); if time>0900 and time<1500 and date<>date[1] then begin highesthi = highest(high[1],5); if high>highesthi then buy next bar at market; end; setexitonclose; now see the chart, it give erroneous signals. I can't understand why this is happening. -
Futures and Options Related Stats.
alex_laxya replied to alex_laxya's topic in Market News & Analysis
There is very good software ' option oracle' SamoaSky | option analysis software It's totally free and I have no vested interest in the software, I found it very useful especially option pain and voltility smile are built in indicators which are useful for option writers like me. Kojak I use one custom software which fetch data from my terminal to multicharts. -
Hi, I am facing some logical error in below code inputs:timeopen(0945); vars: od(0); od = (h-l)*4/5 ; condition1 = (h-l) >= ((o - l) + od) ; condition2 = close>open and (h-l)> average((h-l),10); condition3 = low> low[1] + ((h[1]-l[1])/2) and c >c[1]; if time < timeopen then begin if condition1 and condition2 and condition3 then buy this bar at close; end; if time<time[1] then begin value1 = barssinceentry(1); if value1 >=4 and value1<8 and high> highest(h,3)[1] then buy ("fe") 2 shares next bar at market; end; setexitonclose; Logic is, first three conditions defines open type ( in this code it is open drive) in first half an hour after session open. so far so good, no problem, Now problem arises with second part of the logic, I want to buy highest high of last 5 bars ( tf is 15 min ) after 1 hr of the session start when above three conditions ( condition1, condition2 and condition3) are true. Ex. Market opene at 9 am by 9.30 we get signal as open drive. We wait for an hour then afterwords wait for the opportunity to buy when high is greater than highest high of last 5 bars {( h >(h,5)[1]} but MC cant let it happen because among previous three conditions there is one parameter which says time <0930 ( i.e. time is less than 9.30 am ) so all the code stop working after 9.30am I have tried barssince entry, barcount = barcount+1 etc but it's somehow not working, I can compile the code but it doesnt reflect on chart as per logic. posting the chart for reference.. Uploaded with ImageShack.us
-
Here is POC function..
-
Well here are few guys asking why few dont use investor rt's backtesting tool? I would like a reply from them,wt i found is that,backtesting results r erratic,furthermore there r limitations to backtest profile related studies more than 300days,if ur using developing pocs in ur strategy then its not possible more than 3 months,optimisation takes heck of a time. Having said that market profile users has no any better option than market delta by investor rt,in MC it really sucks,tick handling is poor as blowfish mentioned,i tried one mp strategy n i got yesterdays poc on todays profile so again had to change d code so u can guess that how much tuning u need to do,its like start from d scratch. Eventually u will get mp in MC but then delta related studies again a tough ask,tried to code footprints in it but never get satisfied results,had to work through lot of limitations,hope this time MC guys will build something useful for cd users,its very essential tool for trading,all those candle bars n various ma things are of stone age analysis school,ta has been evolved a lot to cope with information technology & speed of electroic trading,cd is a virtual pit for electroic profile traders hope we wont get deprived of it.
-
Very rightly said. Heard lot of good things about R from few of my friends.
-
in MC make a new function > give a name NEWHD > now copy pest my above posted function. It should work/ compile. Trick is giving name to the function. Later make new signal, give any name, and copy pest second code. Let me know if have any further issues.
-
I am also learning easy language since few days, so lets learn together 1) I think you need to write the function for new high for the day, as there is only default indicator( Not sure about TS, my platform is MC), not default function..function will be like this variables: var0( 0 ) ; if BarType < 2 then begin if Date <> Date[1] then var0 = High else if High > var0 then var0 = High ; NEWHD=var0; end ; 2)write most of the inputs when u want to use numbers within code. So your 50 point below new high of the day will look like this Inputs: filter(50),opentime(0930),closetime(1630); vars:trigger(0),newhdShort(false) ; trigger = newhd[1] - filter ; If marketposition = 0 then begin newhdShort = (time > opentime and time < closetime) and high <= newhd[1] - filter ; If newhdshort then sell short next bar at trigger stop ; setexitonclose ; end; Thats the rough code i have posted, you can improvise on that as per your specific need.
-
well i dont have any intensions discussing about personal stuff, whether i would get there or not or may be i am already there, platform is new for me thats why i raised few basic questions ( & yes problem wasn't about coding ) that doesnt necessarily mean i am a noob who might need basic stuff about what back-testing is, if one really tested 5 years tick data then only can realise how impractical it is or what i am talking about, thats the issue arguing with paper traders lol yes we are mature enough not to rely much on back testing results even after using montecarlo sim & other advance approach.. rofl..its funny when some one stubborn about platform only cuz he/she spend few agonising years to learn the language, i dont have issues learnin c# now if platform doesnt fits in to my skim of things, i wont curve fit the platform by adding extra sleepage only 'cuz it fail to give me accurate entry, have a chill pill sit back & relax like a good kid, i am not talking about scalp alone, quant models cant be back-tested as simple as few statistical arbitrage say pair trading in MultiChart/TS. P. S. No further replies from my end as my issue has been solved.
-
By the way this is biggest draw back of easy lang when it comes to back test scalp strategies which some times enter and exit within one minute in high beta stocks. You must have tick data to back test & which is very impractical if you intend to test on 5 years of data( which is must for robust backtesting). Quantitative strategies are difficult to test for sure. Nothing against any platform, still MC is way better than investor rt, since it provides lot of freedom, at the end of day its part of the package. Talking in perspective of back testing issuers nothing about coding.
-
Oh just remember that i suppose to post here about the solution about my issue, its bar magnifier in multichart backtestin properties which need to be enable & you get your entry NEAR ABOUT YOUR STOP VALUE but not exact at the given stop value if you are unlucky enough to not to have tick data for past few years( just few mb to GB of data ) within the bar even if you say buy next bar at market in easy lang. Sorry for my ignorance as i just shifted to easy lang from investor rt, getting use to the platform now.
-
Thanks for the enlightenment TAMS.
-
well its not that i am research shy person n looking for spoon feeding, i am just looking for direct answer how its coded in MC order type at specific value ? the simplest arrangement with any software, if MC doesnt provide then i believe partial problem is with MC not in coding, furthermore my question is still not answered here & dont see whats the point fingerpointing here n there.
-
yes gone through this sir, and yet my question is same, how it helps me to code how to execute order at specific custom defined value in backtester? tried to use blow fish's approach but it gave wrong entry and exit points. Can some one make real code and post, like this is the way to do this, otherwise started believing MC has this obvious flaw for backtesting intraday methods, there might be some work around but that basic function suppose to be there for easy & frequent use .
-
I could come up with only two possible reasons for this weird thing, they are paranoid of some one might crack it if they keep their s/w for demo without controlling who is downloading it. Second reason could be ..One guy who is using it told its pure vanilla s/w no indicators could be backtested in Ninja. If its true then its visual ease to the eye kind of utility and to make a best use of it you need to have some knowladge of how the order flow works and the secret they only posses and instead using that secret to make real money in market by actual trades they choose to sell it, pretty convincing. Nothing against/for any vendor, just expressing my views.
-
My one friend suggested that in other forum. Suppose, data series 1 is of 1min tf which is for generating trades, data series2 is of 15min tf for generating signals, now if signal appear true on data stream2 ex. High > new high of the day - and i command MC to buy limit order on next bar on data stream 1 which is of 1 min tf but, next bar didnt take out the new high of the day but 12th one min bar took the NHD then logic will be flawed & MC will through an error. :pullhair: :hammer:
-
SIUYA, thanks a lot pal for confirming, this is really a shocker for me. I am using latest beta but situation is same, i cant back-test on value basis, if other experience MC users confirm this then it will be lot of help. By the way whats your latest platform ?
-
Totally, thats what i mean, most of the time when we see market holding on support on low volume this thing happens, but it doesnt mean they always give limit orders below the actual price, volatility need to be consider as well, in high volatility environment OTT (other timeframe traders ) wont wait but rather hit the ask price, you see thats what i mean so many ifs & buts to the extent of curve fitting the vague theory. In market profile we say responsive buying by other time frame traders, they pounce on the opportunity when they think value is reasonable thats the tendency of smart auction player so why would OTT always hit the market price OR ask price ?
-
thanks for the reply, yes aware of this fact, not with MC but i believe no any software could detect what happened first within bar using historical data, you see, in MarketDelta you can assign value by using variable# and make a code like, when condition is true then buy at variable# . I am sure there must be some way in MC otherwise how one can backtest intraday strategies effectively?
-
thanks Tams, i think i need to rephrase my question, i did enable bar magnifier under formating my strategy properties but that only helping for solving entry first or exit first on same bar. Where i stuck is how to tell MC to exit at the exact price when my condition becomes true not on close of this bar? Limit order only possible for next bar where as present bar met the condition, i did try to putting value of present bar on next bar but it gave error. Example to make it more clear - say the code is // (intrabarordergeneration = true) condition1 = ( time > 1000 and time <= 1500) and high >= newhd[1] ; if condition1 then buy this bar at close ; // time frame of the chart is say 15 minute, now if value1 = high >= newhd[1] then, how to write the code when condition1 then buy at value1 ?