How to avoid more than one entry position per week - TradeStation | futures io social day trading
futures io futures trading


How to avoid more than one entry position per week
Updated: Views / Replies:379 / 8
Created: by auato Attachments:0

Welcome to futures io.

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

futures io is the largest futures trading community on the planet, with over 90,000 members. At futures io, our goal has always been and always will be to create a friendly, positive, forward-thinking community where members can openly share and discuss everything the world of trading has to offer. The community is one of the friendliest you will find on any subject, with members going out of their way to help others. Some of the primary differences between futures io and other trading sites revolve around the standards of our community. Those standards include a code of conduct for our members, as well as extremely high standards that govern which partners we do business with, and which products or services we recommend to our members.

At futures io, our focus is on quality education. No hype, gimmicks, or secret sauce. The truth is: trading is hard. To succeed, you need to surround yourself with the right support system, educational content, and trading mentors Ė all of which you can find on futures io, utilizing our social trading environment.

With futures io, you can find honest trading reviews on brokers, trading rooms, indicator packages, trading strategies, and much more. Our trading review process is highly moderated to ensure that only genuine users are allowed, so you donít need to worry about fake reviews.

We are fundamentally different than most other trading sites:
  • We are here to help. Just let us know what you need.
  • We work extremely hard to keep things positive in our community.
  • We do not tolerate rude behavior, trolling, or vendors advertising in posts.
  • We firmly believe in and encourage sharing. The holy grail is within you, we can help you find it.
  • 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.

-- Big Mike, Site Administrator

Reply
 
Thread Tools Search this Thread
 

How to avoid more than one entry position per week

  #1 (permalink)
Trading Apprentice
Bradenton
 
Futures Experience: None
Platform: MultiCharts
Favorite Futures: FTSE MIB
 
Posts: 29 since May 2016
Thanks: 6 given, 4 received

How to avoid more than one entry position per week

Hi all,

Please could you recommend me a solution to avoid more than one entry in the same week? I explain better...
I am trying to build a TS. This TS is a statistical trading system with two levels per week to enter and exit into/from the position. For example, if it enters at the beginning of the week but after a while it exits due to a stop loss triggering I don't desire it enters a second time in the same week (it can may be in the next week but not in the same). I already tried by the difference between ELDateToDateTime(0) - PosTradeExitDateTime(1,0)) <= 4.35 but it doesn't work and anyway I am searching for a better (smarter and simplier solution).

Can you help me please?

Thaank you very much

auato

Reply With Quote
 
  #2 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Hi auato,

you could for example modify the EntriesToday function to work on weeks or set a flag when you enter a trade. This flag could then be checked as part of your entry condition, if the flag is true then no more entries. Now you only have to reset the flag back to false at the end of the week.

The latter idea is probably simpler than modifying the EntriesToday function.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Trading Apprentice
Bradenton
 
Futures Experience: None
Platform: MultiCharts
Favorite Futures: FTSE MIB
 
Posts: 29 since May 2016
Thanks: 6 given, 4 received



ABCTG View Post
Hi auato,

you could for example modify the EntriesToday function to work on weeks or set a flag when you enter a trade. This flag could then be checked as part of your entry condition, if the flag is true then no more entries. Now you only have to reset the flag back to false at the end of the week.

The latter idea is probably simpler than modifying the EntriesToday function.

Regards,

ABCTG

Thank you ABCTG,

for example in this entry condition:
 
Code
IF INSDBAR=0 AND Direction=2 AND close this bar <= FinalMin AND dayofweek(date) <> 5 AND flag=0 then buy ("LIN") 1 contracts next bar at open
How can add also the setting of a flag just it entered? Could you kindly help me to make this line completing the setting after the buy with "flag=1"?

Then, if I got you, at a subsequent line I could write:

 
Code
IF dayofweek(date) = 1, flag=0
in which flag is reset at 0 only on monday and it means that it is ready to enter. flag=1 means it is already entered a trade (but this part is missing because I don't know how to set flag=1 when it enters)

BR,
auato

Reply With Quote
 
  #4 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

auato,

you are welcome.

You can for example set the flag to +1 when your entry conditions are true, although this wouldn't guarantee that you got a fill. So you probably want to either check for a change in the market position or if you are pyramiding check if the number of shares/contracts (using the CurrentContracts reserved word for example) is bigger than on the previous code computation.

Regards,

ABCTG

Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Bradenton
 
Futures Experience: None
Platform: MultiCharts
Favorite Futures: FTSE MIB
 
Posts: 29 since May 2016
Thanks: 6 given, 4 received


ABCTG View Post
auato,

you are welcome.

You can for example set the flag to +1 when your entry conditions are true, although this wouldn't guarantee that you got a fill. So you probably want to either check for a change in the market position or if you are pyramiding check if the number of shares/contracts (using the CurrentContracts reserved word for example) is bigger than on the previous code computation.

Regards,

ABCTG

Thanks, I am trying without success

flag=0 allows to enter
flag=1 does not allow to enter

every monday I reset flag to 0 to enter.

In the middle of week if I exit for a stoploss, everytime the next bar checks currentcontracts, it realizes that currentcontract is 0 and accordingly the falg will be reset and the next bar is ready to enter.


In an IF condition after then I have the order execution command (buy). In addition to the execution statment can I also insert after then the setting of the flag to 1? In this way I avoid the check every time with currentcontracts.

A sort of "IF condition 1 AND condition 2 then buy next bar at market AND flag=1"


Last edited by auato; August 1st, 2016 at 11:15 AM.
Reply With Quote
 
  #6 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

auato,

it's hard to guess for me where the problem could be without knowing the code. You don't have to reveal anything you consider proprietary (you could for example exchange those parts with standard open source codes, as long as the new code is still able to demonstrate the issues), but the more information you provide the easier and more likely it will be for someone to help you.

The "if ... then..." statement in your pseudo code won't work, as the "then" only includes the next code statement. You can however use the "if... then begin.... end ;" statement that will include everything within the "begin... end" in your conditional check.

Regards,

ABCTG

Reply With Quote
 
  #7 (permalink)
Trading Apprentice
Bradenton
 
Futures Experience: None
Platform: MultiCharts
Favorite Futures: FTSE MIB
 
Posts: 29 since May 2016
Thanks: 6 given, 4 received


ABCTG View Post
auato,

it's hard to guess for me where the problem could be without knowing the code. You don't have to reveal anything you consider proprietary (you could for example exchange those parts with standard open source codes, as long as the new code is still able to demonstrate the issues), but the more information you provide the easier and more likely it will be for someone to help you.

The "if ... then..." statement in your pseudo code won't work, as the "then" only includes the next code statement. You can however use the "if... then begin.... end ;" statement that will include everything within the "begin... end" in your conditional check.

Regards,

ABCTG

Hi ABCTG, thank you again.

I report below the code. Omitted only the definition of variables (all set 0 at the beginning of the code) and the calculation of Min and Max which represent the levels to enter and exit for the week. If in the week the TS enters but then it is not able to exit because doesn't touch the other level, a forced exit will be applied on Friday. To limit the bad trades I introduced STPLVL to reduce the losses @2%. STPLVL works well but as the two levels Min and Max are the same for the entire week after an exit our to STPLVL, it unfortunately enters again because there are the seme conditions to enter again. On the other hand, I would like to stop all operations if in that week SPTLVL forces the exit. I work with a time frame 5 minutes.
Maybe as you write, the statement if...then... begin ...end is the correct solution for me because I can set a flag to avoid other entries and to reset that flag the monday morning.


 
Code
IF closeW(1)<openW(1) Then Direction=1 Else Direction=2; //it sets Direction=1 to be short and 2 to be long (Direction=0 is defaulf to be flat)
 

//start the ordering to enter position
 
IF Direction=2 AND close this bar <= Min AND dayofweek(date) <> 5  then buy 1 contracts next bar at open 
       else if Direction=1 AND close this bar >= Max AND dayofweek(date) <> 5  then sellshort 1 contracts next bar at open; 
      
      
//start the ordering to exit position
 
IF marketposition=1 or marketposition=-1 then STPLVL=(Close this bar/entryprice-1); 
 
IF marketposition=1 AND close this bar >=Max OR STPLVL<= -0.02 then
              Sell next bar from Entry at open
              Else
IF marketposition=-1 AND close this bar <=Min OR STPLVL>= 0.02 then
             Buytocover next bar from Entry at open;
 
             
 
//apply the weekly stops

 
IF dayofweek(date) = 5 and time > 1700 AND marketposition=1 then Sell next bar at market
Else
IF dayofweek(date) = 5 and time > 1700 AND marketposition=-1 then buytocover next bar at market;

Reply With Quote
 
  #8 (permalink)
Market Wizard
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation, Multicharts.NET, NinjaTrader, MetaTrader
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,465 since Apr 2013
Thanks: 224 given, 835 received

Hi auato,

I am a bit puzzled, you wrote:

Quoting 
Thanks, I am trying without success

flag=0 allows to enter
flag=1 does not allow to enter

every monday I reset flag to 0 to enter.

In the middle of week if I exit for a stoploss, everytime the next bar checks currentcontracts, it realizes that currentcontract is 0 and accordingly the falg will be reset and the next bar is ready to enter.

This part doesn't seem to exist in the code you posted (at least I don't see it):

 
Code
IF closeW(1)<openW(1) Then Direction=1 Else Direction=2; //it sets Direction=1 to be short and 2 to be long (Direction=0 is defaulf to be flat)
 

//start the ordering to enter position
 
IF Direction=2 AND close this bar <= Min AND dayofweek(date) <> 5  then buy 1 contracts next bar at open 
       else if Direction=1 AND close this bar >= Max AND dayofweek(date) <> 5  then sellshort 1 contracts next bar at open; 
      
      
//start the ordering to exit position
 
IF marketposition=1 or marketposition=-1 then STPLVL=(Close this bar/entryprice-1); 
 
IF marketposition=1 AND close this bar >=Max OR STPLVL<= -0.02 then
              Sell next bar from Entry at open
              Else
IF marketposition=-1 AND close this bar <=Min OR STPLVL>= 0.02 then
             Buytocover next bar from Entry at open;
 
             
 
//apply the weekly stops

 
IF dayofweek(date) = 5 and time > 1700 AND marketposition=1 then Sell next bar at market
Else
IF dayofweek(date) = 5 and time > 1700 AND marketposition=-1 then buytocover next bar at market;
I will gladly steer you in the right direction and help you, but I can't tell you where it goes wrong from the above code.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #9 (permalink)
Trading Apprentice
Bradenton
 
Futures Experience: None
Platform: MultiCharts
Favorite Futures: FTSE MIB
 
Posts: 29 since May 2016
Thanks: 6 given, 4 received

that is the original code, I tried in a second moment to insert a flag and to discuss about this solution as you recommended me but unsuccessfully. So I came back to the original code with no flag

Reply With Quote

Reply



futures io > > > > How to avoid more than one entry position per week

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Introducing daytradr by Jigsaw, new stand-alone platform

Oct 19
 

RandBots: AutoTrading Bots to diversify your trading

Oct 24
 

TopstepTrader: Profiting Without Risking Your Own Money

Oct 26

Building Open Source Indicators for NT8 w/Fat Tails @ Lizard Indicators

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Highest Price after Position Entry stealthtrading NinjaTrader Programming 4 June 5th, 2016 01:31 PM
Avoid Loss - Best Entry Points GFIs1 The Elite Circle 10 November 29th, 2013 03:10 AM
Contract Rollover: Adopt Real World Position and manage per previous position entry RM99 EasyLanguage Programming 3 May 30th, 2012 06:55 AM
Can the Market Avoid a Sixth Straight Down Week? Quick Summary News and Current Events 0 June 9th, 2011 08:40 PM
Avoid being whipsawed on the entry candle. koganam NinjaTrader Programming 1 January 5th, 2010 03:57 AM


All times are GMT -4. The time now is 01:43 AM.

Copyright © 2017 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
Page generated 2017-10-19 in 0.13 seconds with 19 queries on phoenix via your IP 54.161.73.123