ATR Stop

Questions about MultiCharts and user contributed studies.
Jimmyrakete
Posts: 147
Joined: 04 Jun 2014
Has thanked: 2 times

ATR Stop

Postby Jimmyrakete » 20 Sep 2019

this is my first script I ever did.
But you can't!!!

what should it do

when I trade an order by hand it should put a stop according to ATR

I use the signal From Brocker to Strategy

can someone help me with what I'm doing wrong?
Inputs:
tradevolume ( 1 ),
Target_1 ( 1 ),
Target_2 ( 1 ),
ATRLegth ( 10 ),
NumATRs ( 3 );

variable:
var0 ( 0 ),
var1 ( 0 ),
var2 ( 0 );

var0 = averagetruerange ( ATRLegth ) * NumATRs ; // Bezeichnung Indikator
var1 = marketposition ; // abfragen ob eine Position im Markt

if var1 = 1 then
begin
condition1 = var1[1] <> 1 or High > var2 ;
if condition1 then
var2 = High ;
Sell ( "ATR_Long" ) next bar at var2 - var0 Stop ;
end
else
sell ( "AtrLX-eb" ) next bar at High - var0 stop ;

Jimmyrakete
Posts: 147
Joined: 04 Jun 2014
Has thanked: 2 times

Re: ATR Stop

Postby Jimmyrakete » 20 Sep 2019

I got it there.

I can set it so that this window doesn't come so no confirmation
Attachments
order.GIF
(20.99 KiB) Downloaded 165 times

User avatar
Anna MultiCharts
Posts: 560
Joined: 14 Jul 2017
Has thanked: 42 times
Been thanked: 141 times

Re: ATR Stop

Postby Anna MultiCharts » 08 Oct 2019

Hello, Jimmyrakete!

What difficulty you have with the script? Please describe what you do and what you need to achieve step by step.


Return to “MultiCharts”