NexusFi: Find Your Edge


Home Menu

 





need help stopping multiple entries on the same bar


Discussion in EasyLanguage Programming

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




 
Search this Thread

need help stopping multiple entries on the same bar

(login for full post details)
  #1 (permalink)
cboss
charlotte, nc
 
Posts: 1 since Sep 2011
Thanks Given: 0
Thanks Received: 0

can anyone recommend how to prevent a strategy that is supposed to be reversing, from exiting as it should, then entering the same position immediately, then closing this position, and then finally reversing as it should have?

Current code is below:

if strend=1 then buy("in") next bar at open;
If marketposition=1 and cebschaff<longout and cebschaff[1]>longout then sell("out") this bar on close;

If strend<>1 then sellshort("in.") next bar at open;
If marketposition=-1 and cebschaff>shortout and cebschaff[1]<shortout then buytocover("out.") this bar on close;

//pyramiding

If marketposition=1 then begin;
buy ("2nd") next bar at entryprice+(10*tick) stop;
buy ("3rd") next bar at entryprice+(20*tick) stop;
buy ("4th") next bar at entryprice+(30*tick) stop;
buy ("5th") next bar at entryprice+(40*tick) stop;
end;

If marketposition=-1 then begin;
sellshort ("2") next bar at entryprice-(10*tick) stop;
sellshort ("3") next bar at entryprice-(20*tick) stop;
sellshort ("4") next bar at entryprice-(30*tick) stop;
sellshort ("5") next bar at entryprice-(40*tick) stop;
end;

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
Futures Close-Out Policy
Commodities
The space time continuum and the dynamics of a financial …
Emini and Emicro Index
Request for MACD with option to use different MAs for fa …
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Looking for an MQL4 MetaTrader programmer/coder
The Elite Circle
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Just another trading journal: PA, Wyckoff & Trends
33 thanks
Daytrading ES & NQ
32 thanks
Battlestations: Show us your trading desks!
30 thanks
Spoo-nalysis ES e-mini futures S&P 500
28 thanks
Retail Trading As An Industry
25 thanks

(login for full post details)
  #2 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368

 
Thread Moved


Moved to EasyLanguage Programming



When creating a new thread, note which subforum you are in. Here is a short list of suggestions:

- Topic: Anything to do with an Elite indicator -> Subforum: The Elite Circle
- Topic: Looking for an existing indicator, or how-to use an indicator -> Subforum: (the platform)
- Topic: Programmer needing help with non-Elite indicator -> Subforum: (the platform) - Programming
- Topic: Want an indicator created/modified -> Reply to "Want indicator created free" in Elite Circle
- Topic: Vendors (trading rooms, commercial indicators) -> Subforum: Vendors/Product Reviews
- Topic: Discussion of Forex or Currency trading -> Subforum: Forex and Currency Trading
- Topic: Journals of your trading -> Subforum: Trading Journals or Elite Trading Journals
- Topic: General trading related discussions -> Subforum: Traders Hideout
- Topic: Discussion of a trading method -> Subforum: Traders Hideout
- Topic: Automated Trading -> Subforum: Elite Automated Trading

Last, any Elite Member may create more or less any of these topics in The Elite Circle at your own discretion (your support is appreciated).

This is just a short general list and doesn't cover everything. If you are unsure where to create your new thread, just create it in Traders Hideout and a moderator will move it if necessary.

-- Big Mike Trading


We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote
(login for full post details)
  #3 (permalink)
 
Big Mike's Avatar
 Big Mike 
Manta, Ecuador
Site Administrator
Developer
Swing Trader
 
Experience: Advanced
Platform: Custom solution
Broker: IBKR
Trading: Stocks & Futures
Posts: 50,248 since Jun 2009
Thanks Given: 33,111
Thanks Received: 101,368


I would recommend simply adding a few simple print debug statements so you can see the status of strend and marketposition intrabar or bar by bar.

I would also probably rewrite it use a "flag", like a boolean or something that you can set to true when certain group of actions need to be performed, then do all those actions in one group/routine instead of splitting up the entry and exit into multiple sections.

Mike

We're here to help: just ask the community or contact our Help Desk

Quick Links: Change your Username or Register as a Vendor


For the best trading education, watch our webinars
Searching for trading reviews? Review this list


Lifetime Elite Membership: Sign-up for only $149 USD
Receive exclusive offers from our Site Sponsors: Browse Offers
Report problems with the site: Using the NexusFi changelog thread
Follow me on Twitter Visit my NexusFi Trade Journal Reply With Quote





Last Updated on October 1, 2011


© 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