Directional AutoTrading - futures io
futures io

Directional AutoTrading

Discussion in TradeStation

    1. trending_up 731 views
    2. thumb_up 0 thanks given
    3. group 1 followers
    1. forum 1 posts
    2. attach_file 0 attachments

Welcome to futures io: the largest futures trading community on the planet, with well over 125,000 members
  • Genuine reviews from real traders, not fake reviews from stealth vendors
  • Quality education from leading professional traders
  • We are a friendly, helpful, and positive community
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts
  • We are here to help, just let us know what you need
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.

-- Big Mike, Site Administrator

(If you already have an account, login at the top of the page)

Search this Thread

Directional AutoTrading

(login for full post details)
  #1 (permalink)
north bergen
Posts: 13 since Feb 2017
Thanks: 3 given, 1 received

I am having issues with writing a code that allows me to trade direction bias. To elaborate i want data2(larger size bars) to dictate the direction while Data1 ( smaller size bar) to dictate entry and exit. I wrote the code and it complies when i run the signal it trades both ways.

indicator ( 0) ,

var0( 0 ),
var1( 0 ),

VVSUP(false), //trending up
VVSDN(false);// trending DN

var1 = SwingIndex ;
indicator = iff (var1 <0 ,1,-1);
indicator = iff (var1 >0 ,1,-1);

//data2var1 = SwingIndex ;
data2var1 = iff (SwingIndex <0 ,1,-1);
data2var1 = iff (SwingIndex >0 ,1,-1);

if data2var1 > 0
then begin
VVSUP = true;
VVSDN = false;
if data2var1 < 0
then begin
VVSUP = false;
VVSDN = true;

if VVSUP then begin
if indicator crosses over 0 then buy next bar at market;
if marketposition = 1 and Indicator crosses under 0 then sell next bar at market;

if VVSDN then begin
if Indicator crosses under 0 then sellshort next bar at market;
if marketposition =-1 and Indicator crosses over 0 then buytocover next bar at market;

Reply With Quote

Journal Challenge April 2021 results (now extended!):
Competing for $1800 in prizes from Jigsaw
looks_oneMaking a Living with the Microsby sstheo
(302 thanks from 30 posts)
looks_twoSalao's Journalby Salao
(81 thanks from 13 posts)
looks_3Deetee’s DAX Trading Journal (time based)by Deetee
(50 thanks from 20 posts)
looks_4Learning to Profit - A journey in algorithms and optionsby Syntax
(38 thanks from 16 posts)
looks_5Maybe a little bit different journalby Malykubo
(17 thanks from 18 posts)
Best Threads (Most Thanked)
in the last 7 days on futures io
The Crude Dude Oil Trading System
122 thanks
Big Mike in Ecuador
60 thanks
Help improve the FIO community
38 thanks
Next New Poll Ideas/Suggestions
20 thanks
futures io site changelog and issues/problem reporting
16 thanks
(login for full post details)
  #2 (permalink)
 ABCTG   is a Vendor
Posts: 2,238 since Apr 2013
Thanks: 417 given, 1,489 received


as far as I can tell you don't reference Data2 in your code. Depending on what exactly you need, I would suggest looking into how to tie variables and functions to a datastream. For accessing reserved word values on other datastreams, this link should get you going:



Follow me on Twitter Reply With Quote

futures io Trading Community Platforms and Indicators TradeStation > Directional AutoTrading

Last Updated on November 1, 2017

Upcoming Webinars and Events

NinjaTrader Indicator Challenge!


Journal Challenge w/$1,800 in prizes!


An Introduction to CME Group Micro Bitcoin Futures w/David Lerman

Elite only

Copyright © 2021 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, 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