Determine the last bar where a cross occured. - ThinkOrSwim Programming | futures trading

Determine the last bar where a cross occured.
Started: by Genfer Views / Replies:123 / 0
Last Reply: Attachments:0

Welcome to

Welcome, Guest!

This forum was established to help traders (especially futures traders) by openly sharing indicators, strategies, methods, trading journals and discussing the psychology of trading.

We are fundamentally different than most other trading forums:
  • We work extremely hard to keep things positive on our forums.
  • We do not tolerate rude behavior, trolling, or vendor advertising in posts.
  • We firmly believe in openness and encourage sharing. The holy grail is within you, it is not something tangible you can download.
  • We expect our members to participate and become a part of the community. Help yourself by helping others.

You'll need to register in order to view the content of the threads and start contributing to our community. It's free and simple, and we will never resell your private information.

-- Big Mike

Thread Tools Search this Thread

Determine the last bar where a cross occured.

  #1 (permalink)
Trading Apprentice
Futures Experience: Beginner
Platform: IB
Favorite Futures: SPY, ES, Crude
Posts: 1 since Feb 2015
Thanks: 0 given, 0 received

Determine the last bar where a cross occured.


I would like to modify "MovingAvgCrossover" to add a value, say "lastCross", to store the latest bar (or time) when
the cross happened. This will help me to sort my scan following this value.

def avg1 = MovingAverage(averageType1, price, length1);
def avg2 = MovingAverage(averageType2, price, length2);

plot signal = crosses(avg1, avg2, crossingType == CrossingType.above);

Is there a manner to do this in thinkscript?


Reply With Quote

Reply > > > > > Determine the last bar where a cross occured.

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Upcoming Webinars and Events (4:30PM ET unless noted)

2016 True Edge Awards: Voting is open until Jan 21!


Anthony Drager: Pulling the trigger with confidence

Elite only

Leo Murphy: The Art and Science of Technical Analysis

Elite only

FuturesTrader71: Ask Me Anything

Elite only

Similar Threads
Thread Thread Starter Forum Replies Last Post
Strategy To Determine Range Of A Bar samuraisam83 EasyLanguage Programming 3 July 24th, 2015 09:53 AM
MA cross with bar paint Michael Krall NinjaTrader 6 June 21st, 2015 06:55 PM
How to Determine potional P/L on option trade.... mdsvtr Options on Futures 2 December 24th, 2013 05:23 PM
How to step forward bar by bar (F12) with full bar not half bar? mercyman MetaTrader 1 October 23rd, 2012 05:49 PM
How do I determine what size range bar is comparable to a daily bar? Trankuility Traders Hideout 14 January 15th, 2012 11:46 AM

All times are GMT -4. The time now is 08:14 PM.

no new posts
Page generated 2017-01-20 in 0.06 seconds with 19 queries on phoenix via your IP