signal reading price and setting price as sell or buy limit

Questions about MultiCharts and user contributed studies.
elitetrader
Posts: 18
Joined: 06 Jun 2016

signal reading price and setting price as sell or buy limit

Postby elitetrader » 05 Sep 2016

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 this

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: signal reading price and setting price as sell or buy li

Postby TJ » 05 Sep 2016

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 this

Please describe the specifics of your "time series forecast".

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: signal reading price and setting price as sell or buy li

Postby elitetrader » 05 Sep 2016

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 forecast

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: signal reading price and setting price as sell or buy li

Postby TJ » 05 Sep 2016

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 forecast

Please describe the specifics of what you want to do with it.

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: signal reading price and setting price as sell or buy li

Postby elitetrader » 05 Sep 2016

once the swingindex crosses up/down and a trade is placed i want to place a profit target at the price the time series forecast is indicating.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: signal reading price and setting price as sell or buy li

Postby TJ » 05 Sep 2016

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 forecast

When you read the codes in this indicator,
do you understand the functions and purposes of each line?

If not, I will walk you through them.

elitetrader
Posts: 18
Joined: 06 Jun 2016

Re: signal reading price and setting price as sell or buy li

Postby elitetrader » 05 Sep 2016

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
the objective here is to have the profit target dynamic since the time series forecast will forecast a price the market might reach at the next open bar. for example when the swing index crosses up lets say the USDJPY is at 103.500 the time series forecast will indicate a higher price (103.550) which will be the profit target until the next open bar. if the market during that bar reaches 103.550 it will close due to satisfying profittarget price. if not then we wait and see where the market will go after. i hope this is clear for you to understanding my idea
Attachments
explaniation.PNG
(37.93 KiB) Downloaded 558 times


Return to “MultiCharts”