NexusFi: Find Your Edge


Home Menu

 





Unable to change script to represent "ticks"


Discussion in ThinkOrSwim

Updated
    1. trending_up 1,119 views
    2. thumb_up 1 thanks given
    3. group 2 followers
    1. forum 7 posts
    2. attach_file 0 attachments




 
Search this Thread

Unable to change script to represent "ticks"

  #1 (permalink)
 bobbydigital83 
San Francisco Ca/USA
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 29 since Jan 2019
Thanks Given: 12
Thanks Received: 7

I am having problems how to get this to be defined by ticks instead of points.

AddOrder(OrderType.SELL_TO_CLOSE, close > EntryPrice() + 10 or close < EntryPrice() - 8);

I am trying to say close long order when "+10 ticks" in profit or "-8 ticks" in loss

I also tried to think these up but its doesn't seem to be working :

AddOrder(OrderType.buy_TO_CLOSE, close > EntryPrice() + tickvalue () + 10 or close < EntryPrice(), tickvalue () - 8);

and

AddOrder(OrderType.buy_TO_CLOSE, close > EntryPrice() and tickvalue () + 10 or close < EntryPrice(), tickvalue () - 8);

Hopefully someone here can help me out! Thanks in advance!!!



UPDATE:

AddOrder(OrderType.buy_TO_CLOSE, close < EntryPrice() and tickvalue () + 10 or close > EntryPrice() and tickvalue () - 8);

That is producing results. Did I figure it out correctly?

Started this thread Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Build trailing stop for micro index(s)
Psychology and Money Management
ZombieSqueeze
Platforms and Indicators
Deepmoney LLM
Elite Quantitative GenAI/LLM
NexusFi Journal Challenge - April 2024
Feedback and Announcements
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Get funded firms 2023/2024 - Any recommendations or word …
60 thanks
Funded Trader platforms
37 thanks
NexusFi site changelog and issues/problem reporting
24 thanks
GFIs1 1 DAX trade per day journal
22 thanks
The Program
19 thanks
  #2 (permalink)
 bobbydigital83 
San Francisco Ca/USA
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 29 since Jan 2019
Thanks Given: 12
Thanks Received: 7

AddOrder(OrderType.SELL_TO_CLOSE, close > EntryPrice() and tickvalue () + 10 or close < EntryPrice() and tickvalue () - 3);


AddOrder(OrderType.buy_TO_CLOSE, close < EntryPrice() and tickvalue () - 10 or close > EntryPrice() and tickvalue () + 3);

This is the closet I can think of and even though it producing results... its seems skewed. Hopefully someone is able to help me figure this out.

Started this thread Reply With Quote
  #3 (permalink)
 bobbydigital83 
San Francisco Ca/USA
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 29 since Jan 2019
Thanks Given: 12
Thanks Received: 7


AddOrder(OrderType.SELL_TO_CLOSE, tickvalue () + 10 or tickvalue () - 8);




AddOrder(OrderType.buy_TO_CLOSE, tickvalue () - 10 or tickvalue () + 8);

No luck with these either.

Started this thread Reply With Quote
  #4 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106

10 ticks = 2.5 points. Have you tried 2.5 points?

Visit my NexusFi Trade Journal Reply With Quote
  #5 (permalink)
 bobbydigital83 
San Francisco Ca/USA
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 29 since Jan 2019
Thanks Given: 12
Thanks Received: 7

AddOrder(OrderType.SELL_TO_CLOSE, EntryPrice() + 2.5 or EntryPrice() - 1); #TP at +2.5 points or SL at -1 points

AddOrder(OrderType.buy_TO_CLOSE, EntryPrice() - 2.5 or EntryPrice() + 1); #TP at -2.5 points or SL at +1 points


Would this be correct? Results still look skewed.

Started this thread Reply With Quote
  #6 (permalink)
 ocpb 
Hartford CT, USA
 
Experience: Beginner
Platform: None
Trading: ES
Posts: 126 since Jan 2015
Thanks Given: 152
Thanks Received: 125


bobbydigital83 View Post
AddOrder(OrderType.SELL_TO_CLOSE, EntryPrice() + 2.5 or EntryPrice() - 1); #TP at +2.5 points or SL at -1 points

AddOrder(OrderType.buy_TO_CLOSE, EntryPrice() - 2.5 or EntryPrice() + 1); #TP at -2.5 points or SL at +1 points


Would this be correct? Results still look skewed.

I notice this is missing comparison operators, like you'd included in a few prior posts. i.e. "close > X or close < Y"

Reply With Quote
Thanked by:
  #7 (permalink)
 bobbydigital83 
San Francisco Ca/USA
 
Experience: Advanced
Platform: tos
Trading: es
Posts: 29 since Jan 2019
Thanks Given: 12
Thanks Received: 7

It seems its going in the right direction but doesn't seem to behave properly...

AddOrder(OrderType.SELL_TO_CLOSE, close > EntryPrice() + 2 or close < EntryPrice() - 1);


AddOrder(OrderType.buy_TO_CLOSE, close < EntryPrice() - 2 or close > EntryPrice() + 1);

any pointers?

Started this thread Reply With Quote
  #8 (permalink)
 
Massive l's Avatar
 Massive l 
OR/USA
Legendary /NQ Trader
 
Experience: None
Posts: 2,129 since Mar 2011
Thanks Given: 1,859
Thanks Received: 5,106

What's happening when you say it's not behaving properly? screenshots of the strat on a chart would be helpful

Visit my NexusFi Trade Journal Reply With Quote




Last Updated on March 31, 2019


© 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.
About Us - Contact Us - Site Rules, Acceptable Use, and Terms and Conditions - Privacy Policy - Downloads - Top
no new posts