I wish that I could sell it,
it never does just what I want,
but only what I tell it
But anyway,
I have an indicator that I wrote and it works fine and all outputs of a method within the indicator are fine. However, when I call the method from within my strategy, every now and again, I get a previous/incorrect result (I have attached 2 outputs, one for the indicator at 2030 and one for the strategy at 2030).
Any ideas why I would get one set of results for the indicator and an "almost" identical set of results for the strategy?
entryA should only change when all the conditions are met and this works perfectly as an indicator, but call entryA from the strategy and the results differ? Any ideas/thoughts?
Here is a piece of the indicator ... entryA is methodized later
if((High[0] > BullCa() - cTolerance) //BullCa Check
&& (High[0] < BullCb() + cTolerance)
&& ((aValue - xValue) > XAMin)
&& (bBar < aBar)
&&(aBar < xBar)
&& (Low[bBar] > BullB() - bTolerance) //BullB Check
&& (Low[bBar] < BullB() + bTolerance)
//double value = MIN(Low, 20)[0];
&& (MIN(Low,xBar)[0] >= xValue)
&& (MAX(High,xBar)[0] <= aValue)
&& (fireC == 0)) //BullB Check
{
AXDiff = High[aBar] - Low[xBar];
Plot0.Set(BullX()); Plot1.Set(BullA()); //
Plot2.Set(BullB()); //
Plot3.Set(BullCa()); //
Plot4.Set(BullDa()); //
Plot5.Set(BullDb()); //
Plot6.Set(BullTa()); //
Plot7.Set(BullTb()); //
Plot8.Set(BullTc()); //
Plot9.Set(BullTd()); //
entryA = BullDa();
fireC = 1;
}
...in the properties section...
[Browsable(false)]
[XmlIgnore()]
publicdouble EntryA
{
get { Update(); return entryA; }
}
Now for the strategy ...
Print(Time + " : " + storeValue + " : " + GartleyRobotBull(5, 2, 65).EntryA);
if(storeValue != GartleyRobotBull(5, 2, 65).EntryA)
{
storeValue = GartleyRobotBull(5, 2, 65).EntryA;
longCount = 0;
}
//if ((Lows[1][1] > storeValue)
if ((Low[1] > storeValue)
//&& (Lows[1][0] <= storeValue)
&& (Low[0] <= storeValue)
&& (longCount == 0))
{
//EnterLong(1, 1, "Long: 1min");
EnterLong();
longCount=1;
//Print(Time + " : " + storeValue + " : " + Low[0] + " : " + longCount);
}

Comment