Bar Magnifier exit problem - MultiCharts | futures io social day trading
futures io futures trading


Bar Magnifier exit problem
Updated: Views / Replies:674 / 4
Created: by Orjan Attachments:1

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
 

Bar Magnifier exit problem

  #1 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received

Bar Magnifier exit problem

My entry signal is simple. An outside bar on daily chart: If low of the previous bar is taken out first, I buy when also high of the previous bar is taken out. I use IOG and Bar Magnifier.

I want to exit (if possible) in the same bar as entry. The stoploss is filled at the correct place and price, but the profit target is always filled wrongly at open in the next daily bar, despite if profit target price was reached in the entry bar.

So, why does "next bar" mean the next tick for the stoploss line below, but means next bar(Daily) for profit target? Somebody who can help?

Code:

enterLong = (Low < Low[1]) and (MarketPosition(0) = 0);

if (enterLong) then begin

buyPrice = High[1] + 0.0001;
Buy ("Long") 1 contract next bar at buyPrice stop;

end;

if (BarStatus(1) = 2) and (MarketPosition(0) = 1) then
Sell ("XLPT") all contracts next bar at entryprice + profittarget or higher; //THIS LINE DOES NOT WORK! WHY?//
Sell ("XLSL") all contracts next bar at entryprice - stoploss or lower; //THIS LINE IS OK//

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,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Orjan,

because you do this check "if (BarStatus(1) = 2) and (MarketPosition(0) = 1) then" in front of the profit order. It will be only checked at the end of the bar. The check won't affect the stop order and that's why this seems to work.

Regards,
ABCTG


Orjan View Post
My entry signal is simple. An outside bar on daily chart: If low of the previous bar is taken out first, I buy when also high of the previous bar is taken out. I use IOG and Bar Magnifier.

I want to exit (if possible) in the same bar as entry. The stoploss is filled at the correct place and price, but the profit target is always filled wrongly at open in the next daily bar, despite if profit target price was reached in the entry bar.

So, why does "next bar" mean the next tick for the stoploss line below, but means next bar(Daily) for profit target? Somebody who can help?

Code:

enterLong = (Low < Low[1]) and (MarketPosition(0) = 0);

if (enterLong) then begin

buyPrice = High[1] + 0.0001;
Buy ("Long") 1 contract next bar at buyPrice stop;

end;

if (BarStatus(1) = 2) and (MarketPosition(0) = 1) then
Sell ("XLPT") all contracts next bar at entryprice + profittarget or higher; //THIS LINE DOES NOT WORK! WHY?//
Sell ("XLSL") all contracts next bar at entryprice - stoploss or lower; //THIS LINE IS OK//


Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #3 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received


Thanks ABCTG,

That solved the problem with exit in the wrong bar.

But as you see in pic1 the profit (XLPT) is taken at different levels, either on the high of the bar, or on the close of the bar. My profit target is in code test only 10 points above entryprice. and should have been filled before close/high. Code:

enterLong = (Low < Low[1]) and (MarketPosition(0) = 0);

if (enterLong) and (barssinceexit(1) >1 OR totaltrades <1)then begin

buyPrice = High[1] + 0.0001;
Buy ("Long") 1 contract next bar at buyPrice stop;

end;

if (MarketPosition = 1) then // If this line is deleted entry and exit is filled at the same price = no profit //
Sell ("XLPT") all contracts next bar at entryprice + profittarget or higher; // profittarget=10 p //
Sell ("XLSL") all contracts next bar at entryprice - stoploss or lower; // stoploss=10 p //

Attached Thumbnails
Bar Magnifier exit problem-pic1.jpg  
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,533 since Apr 2013
Thanks: 231 given, 855 received
Forum Reputation: Legendary

Orjan,

I don't know what you intend with the way you coded the stop and target orders (I know what you are trying I guess) as you didn't specify any order type.
Something like this might get you going. However an exit at the same bar than the entry is best done with intrabar order generation (hence the name).

 
Code
if (MarketPosition = 1) then  
begin           
   Sell ("XLPT") all contracts next bar at entryprice + profittarget limit;  // profittarget=10 p //
   Sell ("XLSL") all contracts next bar at entryprice - stoploss stop;	    // stoploss=10 p //
end ;
Regards,
ABCTG


Orjan View Post
Thanks ABCTG,

That solved the problem with exit in the wrong bar.

But as you see in pic1 the profit (XLPT) is taken at different levels, either on the high of the bar, or on the close of the bar. My profit target is in code test only 10 points above entryprice. and should have been filled before close/high. Code:

enterLong = (Low < Low[1]) and (MarketPosition(0) = 0);

if (enterLong) and (barssinceexit(1) >1 OR totaltrades <1)then begin

buyPrice = High[1] + 0.0001;
Buy ("Long") 1 contract next bar at buyPrice stop;

end;

if (MarketPosition = 1) then // If this line is deleted entry and exit is filled at the same price = no profit //
Sell ("XLPT") all contracts next bar at entryprice + profittarget or higher; // profittarget=10 p //
Sell ("XLSL") all contracts next bar at entryprice - stoploss or lower; // stoploss=10 p //


Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Stockholm Sweden
 
Futures Experience: Intermediate
Platform: Multicharts
Favorite Futures: Futures, forex
 
Posts: 20 since Apr 2012
Thanks: 12 given, 2 received

ABCTG,

I have tried using limit and stop order, and that gives the same result as "or higher/lower": in both cases profit target is filled at high or close of the bar. Not at +10 points as expected. I use Intrabar Order Generation, I wrote "IOG" above, sorry for not beeing clear. This is my entire compiled code:

[IntrabarOrderGeneration = true];

Inputs:
profittarget(0.0010),
stoploss(0.0010);

Variables:
enterLong(False),
buyPrice(0);

enterLong = (Low < Low[1]) and (MarketPosition(0) = 0);

if (enterLong) and (barssinceexit(1) >1 OR totaltrades <1) then begin

buyPrice = High[1] + 0.0001;
Buy ("Long") 1 contract next bar at buyPrice stop;

end;

if (MarketPosition = 1) then begin
Sell ("XLPT") all contracts next bar at entryprice + profittarget limit;
Sell ("XLSL") all contracts next bar at entryprice - stoploss stop;
end;

Reply With Quote

Reply



futures io > > > > Bar Magnifier exit problem

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Jigsaw Trading: TBA

Elite only

FuturesTrader71: TBA

Elite only

NinjaTrader: TBA

Jan 18

RandBots: TBA

Jan 23

GFF Brokers & CME Group: Futures & Bitcoin

Elite only

Adam Grimes: TBA

Elite only

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Whats the difference between Bar Magnifier & look inside bar testing? crbucks MultiCharts 1 May 4th, 2011 01:22 AM
Do we need to use the bar magnifier when backtesting/optimization in MultiCharts? benharrell MultiCharts 8 May 4th, 2011 01:17 AM
Difference between IntraBarOrderGeneration and Bar Magnifier arjfca EasyLanguage Programming 13 March 23rd, 2011 02:28 PM
MultiCharts Bar Magnifier Question benharrell EasyLanguage Programming 2 January 11th, 2011 07:22 PM
Multicharts "Bar Magnifier + Trailing stop" Bulby EasyLanguage Programming 2 June 10th, 2010 07:11 AM


All times are GMT -4. The time now is 01:30 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-12-18 in 0.12 seconds with 20 queries on phoenix via your IP 54.92.201.232