Code: Select all
if SwingIndex >0 then buy next bar at market;
if SwingIndex <0 then sellshort next bar at market;
Code: Select all
if SwingIndex >0 then buy next bar at market;
if SwingIndex <0 then sellshort next bar at market;
now i want to add time series forecast ( using time series forecast as a signal) to place a profit target at the price it forecast when the swingindex signal places a trade how do i go on getting thisCode: Select all
if SwingIndex >0 then buy next bar at market;
if SwingIndex <0 then sellshort next bar at market;
Code: Select all
inputs:
Length( 9 ),
BarsPlus( 7 ) ;
variables:
var0( 0 ) ;
var0 = TimeSeriesForecast( Length, BarsPlus ) ;
Plot1( var0, "TSF" ) ;
condition1 = Close > var0 and var0 > var0[1] and var0[1] <= var0[2] ;
if condition1 then
Alert( "Indicator turning up" )
else
begin
condition1 = Close < var0 and var0 < var0[1] and var0[1] >= var0[2] ;
if condition1 then
Alert( "Indicator turning down" ) ;
end;
this is the normal time series forecastCode: Select all
inputs:
Length( 9 ),
BarsPlus( 7 ) ;
variables:
var0( 0 ) ;
var0 = TimeSeriesForecast( Length, BarsPlus ) ;
Plot1( var0, "TSF" ) ;
condition1 = Close > var0 and var0 > var0[1] and var0[1] <= var0[2] ;
if condition1 then
Alert( "Indicator turning up" )
else
begin
condition1 = Close < var0 and var0 < var0[1] and var0[1] >= var0[2] ;
if condition1 then
Alert( "Indicator turning down" ) ;
end;
this is the normal time series forecastCode: Select all
inputs:
Length( 9 ),
BarsPlus( 7 ) ;
variables:
var0( 0 ) ;
var0 = TimeSeriesForecast( Length, BarsPlus ) ;
Plot1( var0, "TSF" ) ;
condition1 = Close > var0 and var0 > var0[1] and var0[1] <= var0[2] ;
if condition1 then
Alert( "Indicator turning up" )
else
begin
condition1 = Close < var0 and var0 < var0[1] and var0[1] >= var0[2] ;
if condition1 then
Alert( "Indicator turning down" ) ;
end;
Code: Select all
inputs:
Length( 2 ),
BarsPlus( -3 ) ;
variables:
var0( 0 ) ;
var0 = TimeSeriesForecast( Length, BarsPlus ) ;
if swingindex crosses above 0 then buy next bar at market;
if swingindex crosses below 0 then sellshort next bar at market;
setstopshare;
setprofittarget ( var0); // yes this is wrong but this is the idea i am trying to accomplish