Dark
Theme
Light
Theme
Register
Username or Email
Username or Email
Password
Password
Forgot
Signup
Forgot
Browse
Register
Downloads / Indicators
Articles
Upgrade to Elite
Unanswered Posts
My Posts
Return to Homepage
Today's Posts
Trading Reviews and Vendors
Futures Brokers Reviews
Traders Hideout (general)
Platforms and Indicators
Trading Journals
Elite Trading Journals
Psychology and Money Management
Off-Topic
The Elite Circle
Webinars
Trading Articles
Main Trading Articles Index
Article Categories
Help, Tutorials, How-To's
Traders and Trading Methods
Platforms, Tools and Indicators
Terms (Glossary)
Article Tools
List New Articles
List Recent Article Changes
Random Article
Most Popular Articles
Category Groupings
Wanted Articles
Most Linked to from Forum
Go to Page...
Home
>
Info
Full content requires Elite Membership, the below is only a preview of the first post in the discussion.
help w/tos script
input displace = 1;
input length1 = 8;
input length2 = 21;
input averageType = AverageType.WILDERS;
input atrlength = 1;
plot ATR = Average(TrueRange(high, close, low), ATRLength) / close;
def h = high[displace];
def l = low[displace];
def c = close;
def bn = BarNumber();
def na = Double.NaN;
def cb = highestAll(if !IsNaN(c) and IsNaN(c[-1]) then bn else na);
#plot Lb = Lowest(l, length1);
#Lb.SetDefaultColor(GetColor(8));
def Ub = Highest(h, length1);
#Ub.SetDefaultColor(Color.cyan);
plot ubatr = ub - ub * (atr*0.01);
ubatr.SetDefaultColor(Color.green);
def Lb2 = Lowest(l, length2);
#Lb2.SetDefaultColor(Color.red);
plot lb2atr = lb2 - lb2 * (atr*0.001) ;
#Ub2.SetDefaultColor(Color.RED);
lb2atr.SetDefaultColor(Color.cyan);
#plot Ub2 = Highest(h, length2);
#Ub2.SetDefaultColor(GetColor(8));
def ubLong = high crosses above Ubatr;
def ubEntry = if ubLong then ubatr else ubEntry[1];
#def ubLong = c crosses above Ub;
#def ubEntry = if ubLong then c else ubEntry[1];
def ubStop = if ubLong then Lb2atr else ubStop[1];
def ubT1 = if ubLong then ubEntry + 1.5 * (ubEntry - ubStop) else uBT1[1];
def ubT2 = if ubLong then ubEntry +3.5* (ubEntry - ubStop) else uBT2[1];
def longTradeOn = if ubLong
then 1
else if low crosses below ubStop
# or high crosses above ubT2
then 0
else longTradeOn[1];
def activeTrade = HighestAll(if bn == cb then longTradeOn else na);
plot Buy = if activeTrade then ubEntry else na;
Buy.SetDefaultColor(Color.white);
buy.SetPaintingStrategy(PaintingStrategy.horizontal);
buy.SetLineWeight(1);
plot Stop = if activeTrade then ubStop else na;
Stop.SetDefaultColor(Color.red);
stop.SetPaintingStrategy(PaintingStrategy.horizontal);
stop.SetLineWeight(1);
plot TargetOne = if activeTrade then ubT1 else na;
TargetOne.SetDefaultColor(Color.yellow);
TargetOne.SetPaintingStrategy(PaintingStrategy.horizontal);
TargetOne.SetLineWeight(1);
plot TargetTwo = if activeTrade then ubT2 else na;
TargetTwo.SetDefaultColor(Color.cyan);
TargetTwo.SetPaintingStrategy(PaintingStrategy.horizontal);
TargetTwo.SetLineWeight(1);
def location = !IsNaN(c) and IsNaN(c[-1]);
AddChartBubble(activetrade and location, ubEntry, "Entry: "+ubEntry, Buy.TakeValueColor());
AddChartBubble(activetrade and location, ubStop, "Stop: "+ubStop, Stop.TakeValueColor());
AddChartBubble(activetrade and location, ubT1, "T1: "+ubT1, TargetOne.TakeValueColor());
AddChartBubble(activetrade and location, ubT2, "T2: "+ubT2, TargetTwo.TakeValueColor());
#need to plot only first entry unless it hits the stop loss or second target then plot entry again ,also if can be converted to ninjatrader ,thanks ,
Click to create a user account
Already have an account? Sign in
Log in
User Name or Email:
Password:
Forgotten Your Password?
futures io is now NexusFi
Trading Webinars How-to's
Trading Reviews & Products
Futures Broker Reviews
NinjaTrader Brokerage (Broker)
Kinetick (Data Feed Provider)
Apex Trader Funding (Prop Trading)
Tradovate (Trading Platform)
NinjaTrader (Trading Platform)
SharkIndicators (Trading Software)
© 2024 NexusFi™, s.a., All Rights Reserved.
Av Ricardo J. Alfaro, Century Tower, Panama City, Panama, Ph: +507 833-9432 (Panama and Intl), +1 888-312-3001 (USA and Canada)
All information is for educational use only and is not investment advice. There is a substantial risk of loss in trading commodity futures, stocks, options and foreign exchange products. Past performance is not indicative of future results.
no new posts