Easylanguage/Multicharts still buying next bar even no more code to buy signal! - MultiCharts | futures io social day trading
futures io futures trading


Easylanguage/Multicharts still buying next bar even no more code to buy signal!
Updated: Views / Replies:1,931 / 14
Created: by risaldeb 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
 

Easylanguage/Multicharts still buying next bar even no more code to buy signal!

  #11 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: Options
 
Posts: 10 since Feb 2015
Thanks: 1 given, 0 received


Jura View Post
You can use BarStatus to ensure that `var0` is calculated on bar close and not on every tick. For example:

 
Code
Variables:
  var0(0),
  buyOrder(false);

if (BarStatus(1) = 2) then begin

  // Calculate var0 on bar close
  var0 = ...
  
  // Generate the order condition
  if (Low > var0) then
    buyOrder = true;

end;

// This code is executed on every tick
if (buyOrder = true) then begin

  // Submit order

end;

Hi Jura,

Sorry to bother you again. I am trying to fully understand the BarStatus function and so I tried below code to see if it works for me but unfortunately it did not react as I expected.

If (BarStatus(1) = 1) and (BarStatus(2) = 1) then begin//I am assuming BarStatus(1) is same as Bar[1] etc...correct?
Gap1= high[2]*GapUp;
if (low[1]>Gap1) and (close<high[1]) then
FalseGapUp1=True;
End;
If (BarStatus(1) = 1) and (BarStatus(2) = 1) and (BarStatus(3) = 1) then begin
Gap2= high[3]*GapUp;
if (low[2]>Gap2) and (close<low[1]) then
FalseGapUp2=True;
End;

Is my assumption that BarStatus(1) is the same as Bar[1]? If not how can I code if IOG=true and I like to use 30 minutes Bar[3], Bar[2] and Bar[1]?

Reply With Quote
 
  #12 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


risaldeb View Post
Is my assumption that BarStatus(1) is the same as Bar[1]? If not how can I code if IOG=true and I like to use 30 minutes Bar[3], Bar[2] and Bar[1]?

Follow the link in my previous post for more information about `BarStatus`; your assumption is not correct I'm afraid.

By the way, previous bars (i.e., bars that have closed) will always have a `BarStatus` value of 2 (= closed).

Reply With Quote
 
  #13 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: Options
 
Posts: 10 since Feb 2015
Thanks: 1 given, 0 received



Jura View Post
Follow the link in my previous post for more information about `BarStatus`; your assumption is not correct I'm afraid.

By the way, previous bars (i.e., bars that have closed) will always have a `BarStatus` value of 2 (= closed).

OMG! So how can I code it then with the following logic if IOG = True. Here's what I wanted to achieve if IOG=False but I like it to function under IOG=True. This strategy is to determine when there is a false gap up of 30 minutes bar.


Gap1= high[2]*GapUp;//Gap occurs the previous 30 min bar.
if (low[1]>Gap1) and (close<high[1]) then
FalseGapUp1=True;
End;

Gap2= high[3]*GapUp;// gap occurs the previous 2 30 min bars.
if (low[2]>Gap2) and (close<low[1]) then
FalseGapUp2=True;
End;

Reply With Quote
 
  #14 (permalink)
 Vendor: tradingcode.net 
The Netherlands
 
Futures Experience: None
Platform: MultiCharts, TradingView
Favorite Futures: ...
 
Jura's Avatar
 
Posts: 774 since Apr 2010
Thanks: 2,347 given, 661 received


risaldeb View Post
Here's what I wanted to achieve if IOG=False but I like it to function under IOG=True.

If code should work under IOG the same way as without IOG, all you need to do is add the `BarStatus` keyword since the only difference between IOG and non-IOG is whether the prices are processed intra-bar (IOG) or just on bar close (non-IOG).

So making your code behave in the same way with IOG enabled as it did with IOG disabled would be:

 
Code
if (BarStatus(1) = 2) then begin

    Gap1= high[2]*GapUp;//Gap occurs the previous 30 min bar.
    if (low[1]>Gap1) and (close<high[1]) then
    FalseGapUp1=True;
    End;

    Gap2= high[3]*GapUp;// gap occurs the previous 2 30 min bars. 
    if (low[2]>Gap2) and (close<low[1]) then
    FalseGapUp2=True;
    End;

end;

Reply With Quote
 
  #15 (permalink)
Trading Apprentice
Hong Kong
 
Futures Experience: Advanced
Platform: Multicharts
Favorite Futures: Options
 
Posts: 10 since Feb 2015
Thanks: 1 given, 0 received


Jura View Post
If code should work under IOG the same way as without IOG, all you need to do is add the `BarStatus` keyword since the only difference between IOG and non-IOG is whether the prices are processed intra-bar (IOG) or just on bar close (non-IOG).

So making your code behave in the same way with IOG enabled as it did with IOG disabled would be:

 
Code
if (BarStatus(1) = 2) then begin

    Gap1= high[2]*GapUp;//Gap occurs the previous 30 min bar.
    if (low[1]>Gap1) and (close<high[1]) then
    FalseGapUp1=True;
    End;

    Gap2= high[3]*GapUp;// gap occurs the previous 2 30 min bars. 
    if (low[2]>Gap2) and (close<low[1]) then
    FalseGapUp2=True;
    End;

end;

Many Thanks Again Jura, You make my day happy once again. Your help works. I just tweaked a little and it perfectly work according to my liking. Here is what I did.

if (BarStatus(1) = 1) then begin

Gap1= high[2]*GapUp;//Gap occurs the previous 30 min bar.
if (low[1]>Gap1) and (close<high[1]) then
FalseGapUp1=True;


Gap2= high[3]*GapUp;// gap occurs the previous 2 30 min bars.
if (low[2]>Gap2) and (close<low[1]) then
FalseGapUp2=True;


end;

Reply With Quote

Reply



futures io > > > > Easylanguage/Multicharts still buying next bar even no more code to buy signal!

Thread Tools Search this Thread
Search this Thread:

Advanced Search



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

Linda Bradford Raschke: Reading The Tape

Elite only

Adam Grimes: TBA

Elite only

NinjaTrader: TBA

January

Ran Aroussi: TBA

Elite only
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
buy next bar... and set stop immediately and not for the bar after Nicolas11 EasyLanguage Programming 12 September 18th, 2017 05:43 AM
One buy signal from multiple time frames smolarek NinjaTrader 0 March 10th, 2015 12:33 AM
Easylanguage help needed, from signal to function jjsshh EasyLanguage Programming 14 August 5th, 2014 11:05 AM
EasyLanguage entry in active bar on previous bar's low tolu7325 EasyLanguage Programming 3 July 29th, 2013 10:08 AM


All times are GMT -4. The time now is 02:53 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-12 in 0.11 seconds with 29 queries on phoenix via your IP 54.90.207.75