Download software Tutorial videos
Subscription & data-feed pricing Class schedule


New account application Trading resources
Margin rates Stock & option commissions

Attention: Discussion forums are read-only for extended maintenance until further notice.
Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

IF...statments Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
robejohg
Posted : Saturday, October 8, 2016 10:24:31 AM
Registered User
Joined: 4/5/2014
Posts: 4

I am tring to create a line to do  back test.

Goal is:

Entry is made at price C

StopLoss (SL) is C - y (y is calulated before entry and does not change)

So:

 

If C>C1 then SL=C-y

else SL=SL

I can get this work as a yes - no but cannot get a line. Is this possible?

Thanks

diceman
Posted : Saturday, October 8, 2016 1:50:15 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

Im not sure I understand what you are asking but you could try:

 

ABS(C>C1)*(SL)

 

Plotted as a dot on the price scale.

 

 

Thanks

 

diceman
Posted : Saturday, October 8, 2016 1:58:16 PM
Registered User
Joined: 1/28/2005
Posts: 6,049

Whoops I missed the "else"

Something like this maybe:

 

Abs(C>C1)*(C-y)+ABS(C<=C1)*(SL)

 

 

Thanks

 

 

 

 

 

 

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.