I have an Indicator with following public variables defined in the indicator
MyIndicator
{
public double CurrentHI
public double CurrentLO
// Followed by some calcuation to decide the values of these two.
// in the onbarupdate method
// I AM NOT PLOTTING THESE ON THE INDICATOR. I am plotting some other things
} //end My Indicator
In MyStrategy I need to access these two variables for making some decision and my code is looking somehting like following
MyStrategy
{
initialize
{
Add(MyIndicator) // This takes care of plotting part which is working fine
} //end initialize
onbarupdate
{
if (MyIndicator().CurrentHI >= 1000)
{
//do something i.e. Enter long
}//end if
} // end onbarupdate
} //end my strategy
The thing is ..
there is no compilation error and strategy compile perfectly..
but when I run it, Anything Inside of the IF doesnt get executed...
I am wondering why .
Tried this twice with two different indicators.. doesnt work..
HOWEVER.. when I copy paste all the code from indicator into the strategy ... the execution works.. NOW THAT TAKES AWAY the capability to plot the other things I wanna plot..
HELP HELP HELP
Thanks
R
Comment