Market Position shows no change - futures io
futures io futures trading



Market Position shows no change


Discussion in EasyLanguage Programming

Updated by vmodus
    1. trending_up 653 views
    2. thumb_up 6 thanks given
    3. group 2 followers
    1. forum 4 replies
    2. attach_file 1 attachments




Welcome to futures io: the largest futures trading community on the planet, with well over 100,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
 

Market Position shows no change

(login for full post details)
  #1 (permalink)
Istanbul
 
 
Posts: 25 since Sep 2020
Thanks: 13 given, 16 received

Hi everyone,

I coded a simple strategy where I want to draw lines for a trailing stop.
Since I dont have any lines on the graph, I checked the print log. There it seems that even when I enter a long trade, the market position doesnt turn to 1.
Since I have a trailing stop, I suspect that the long trade is stopped out immediately, but even when I put the stop very large nothing shows up.
Whats wrong here? Hope you guys can help!

Thanks!

This is my code


input: NumTicks(10),
Length(14);
Vars: Avg(0),
TickVal(MinMove/PriceScale),
Trail(0),
MP(0);

MP = Marketposition;
Avg= Average(Close,Length);

if Close crosses over Avg then Buy next bar at market;
TL_New(d[1],t[1],Avg[1],d,t,Avg);

Setdollartrailing (NumTicks * TickVal * Bigpointvalue);


if MP = 1 Then
Begin
Trail = maxlist(Trail, Low - (NumTicks*TickVal));
Value1 = TL_new(d[1],t[1],Trail[1],d,t,Trail);
Value3 = Text_New(d,t,Trail,"*");
end;

if MP = 0 then Trail = 0; [/COLOR]

Reply With Quote

Can you help answer these questions
from other members on futures io?
Move indicator on Chart
NinjaTrader
Time Specific Volume Bars for Market Hours? Thinkorswim
ThinkOrSwim
Heat Map on Trendspider
Platforms and Indicators
Seeking an MT4 Indicator/EA that scans all Currency Pairs to identify setup
Platforms and Indicators
Can anyone help convert this pine script to c# or vb?
MultiCharts
 
 
(login for full post details)
  #2 (permalink)
Legendary Market Wizard
Somewhere, Delawhere, USA
 
Experience: Intermediate
Platform: TradeStation,Sierra Chart
Broker: Tradestation Securities
Trading: My kids, VX, Eurodollar
 
vmodus's Avatar
 
Posts: 809 since Feb 2017
Thanks: 1,499 given, 1,473 received

I just tried your code (TS v10) and it works for me on a 25 tick and 1 minute RB charts:




Here is the code I used (I commented out the things I believe are your custom functions):


input:
NumTicks(10),
Length(14);


Vars:
Avg(0),
TickVal(MinMove/PriceScale),
Trail(0),
MP(0);

MP = Marketposition;
Avg= Average(Close,Length);

if Close crosses over Avg then Buy next bar at market;

//TL_New(d[1],t[1],Avg[1],d,t,Avg);

Setdollartrailing (NumTicks * TickVal * Bigpointvalue);


if MP = 1 Then
Begin
Trail = maxlist(Trail, Low - (NumTicks*TickVal));
//Value1 = TL_new(d[1],t[1],Trail[1],d,t,Trail);
//Value3 = Text_New(d,t,Trail,"*");
end;

if MP = 0 then Trail = 0;

~vmodus

Enjoy everything!
Visit my futures io Trade Journal Reply With Quote
The following 3 users say Thank You to vmodus for this post:
 
(login for full post details)
  #3 (permalink)
Legendary Market Wizard
Somewhere, Delawhere, USA
 
Experience: Intermediate
Platform: TradeStation,Sierra Chart
Broker: Tradestation Securities
Trading: My kids, VX, Eurodollar
 
vmodus's Avatar
 
Posts: 809 since Feb 2017
Thanks: 1,499 given, 1,473 received


.... one more thing my wife mentioned regarding the setdollartrailing function: make sure to set 'Use Look-Inside-Bar Back-testing' in the Strategy Properties, otherwise your results will look too good to be true, and rightly so. We use 1 minute in our settings for our time-based charts.

I hope this helps.

~vmodus

Enjoy everything!
Visit my futures io Trade Journal Reply With Quote
The following 2 users say Thank You to vmodus for this post:
 
(login for full post details)
  #4 (permalink)
Istanbul
 
 
Posts: 25 since Sep 2020
Thanks: 13 given, 16 received


vmodus View Post
.... one more thing my wife mentioned regarding the setdollartrailing function: make sure to set 'Use Look-Inside-Bar Back-testing' in the Strategy Properties, otherwise your results will look too good to be true, and rightly so. We use 1 minute in our settings for our time-based charts.

I hope this helps.


Dear Vmodus, sorry for the late reply but this really helped!
Especially the advice about the look inside bar back testing, your wife is a tradestation coder too? That must be awesome both of you doing the same at home!

Reply With Quote
The following user says Thank You to JBroex for this post:
 
(login for full post details)
  #5 (permalink)
Legendary Market Wizard
Somewhere, Delawhere, USA
 
Experience: Intermediate
Platform: TradeStation,Sierra Chart
Broker: Tradestation Securities
Trading: My kids, VX, Eurodollar
 
vmodus's Avatar
 
Posts: 809 since Feb 2017
Thanks: 1,499 given, 1,473 received


JBroex View Post
Dear Vmodus, sorry for the late reply but this really helped!
Especially the advice about the look inside bar back testing, your wife is a tradestation coder too? That must be awesome both of you doing the same at home!

You're welcome. It does help to have two brains on some of the problems we try to solve. Sometimes it works, too.

~vmodus

Enjoy everything!
Visit my futures io Trade Journal Reply With Quote


futures io Trading Community Platforms and Indicators EasyLanguage Programming > Market Position shows no change


October 14, 2020


Upcoming Webinars and Events
 

Order Flow Tools w/MotiveWave & Zytrade Brokerage

Oct 22
 

Technical Analysis Workshop w/NinjaTrader

Oct 27
 

Bookmap

Oct TBD
 

SharkIndicators

Oct TBD
 

Carley Garner

Oct TBD
 

GruttePier

Oct TBD
     



Copyright © 2020 by futures io, s.a., Av Ricardo J. Alfaro, Century Tower, Panama, +507 833-9432, info@futures.io
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