Delhi India
Posts: 1 since Feb 2014
Thanks Given: 0
Thanks Received: 0
|
I am trying to buy 2 pips above the previous candle high when the MACD cross above happens. Code is this
inputs: FastLength( 5 ), SlowLength( 70 ), MACDLength( 100 ) ;
variables: var0( 0 ), var1( 0 ), var2( 0 ) , var3(0);
var0 = MACD( Close, FastLength, SlowLength ) ;
var1 = XAverage( var0, MACDLength ) ;
var2 = var0 - var1 ;
var3 = High[1]+1.0;
condition1 = CurrentBar > 2 and var2 crosses over 0 ;
if condition1 then
Buy( "MacdLE" ) next bar at var3 stop;
But then when I am seeing the buy value, it is showing at High[1] only and not additional 1.0 point above
Can you please help?
Thanks
|