Plot only once help - MultiCharts | futures io social day trading
futures io futures trading


Plot only once help
Updated: Views / Replies:329 / 5
Created: by olobay Attachments:2

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
 

Plot only once help

  #1 (permalink)
Elite Member
Montreal
 
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
 
Posts: 261 since Jul 2011
Thanks: 288 given, 332 received

Plot only once help

Hi,

I have this Show Me code that I would like to plot only once, only the first time the conditions are met. Or if the last plot was a "Buy" plot, then the next plot can only be a "Sell" plot. So it would alternate between one plot for a sell and the next plot for a buy and then the next plot would be a sell. But I think it would be easier if the code would just plot it once the first time the conditions are met. Any help is appreciated.

 
Code
input: offset(.05);

variables: Range(0);

Range=(Open + Close) /2;

if close of Data2 >= Range of Data1 then
	begin
	Plot1( Low - offset, "Buy") ;
	end
	Else Begin
	NoPlot(0);
	end;
	
if close of Data2 <= Range of Data1 then
	begin
	Plot1( High + offset, "Sell") ;
	end
	Else Begin
	NoPlot(0);
	end;

Attached Thumbnails
Plot only once help-no-plot.png  
Reply With Quote
 
  #2 (permalink)
Elite Member
Milan (Italy)
 
Futures Experience: Advanced
Platform: TradeStation, MC, TWS
Broker/Data: TradeStation, IB
Favorite Futures: Futures, Forex
 
tradingest's Avatar
 
Posts: 96 since Dec 2014
Thanks: 5 given, 9 received

you can use Once to plot one time

Reply With Quote
The following user says Thank You to tradingest for this post:
 
  #3 (permalink)
Elite Member
Montreal
 
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
 
Posts: 261 since Jul 2011
Thanks: 288 given, 332 received


I tried the following but it only plotted the first time the condition happened on the chart. I don't think I was clear. I would like it to plot every time my condition is met, but only the first bar that it is met and not every single bar.

 
Code
input: offset(.05);

variables: Range(0);

Range=(Open + Close) /2;

once (close of Data2 >= Range of Data1)
	begin
	Plot1( Low - offset, "Buy") ;
	end;
	
once (close of Data2 <= Range of Data1)
	begin
	Plot1( High + offset, "Sell") ;
	end;
This is where I would like it to plot but only on the bars with arrows:

Please register on futures.io to view futures trading content such as post attachment(s), image(s), and screenshot(s).

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,527 since Apr 2013
Thanks: 229 given, 853 received
Forum Reputation: Legendary

olobay,

you could use a boolean variable that you check together with your condition. If your conditions are met, you will set the boolean to true as well. Now you just have to reset the boolean to false again in order to allow for a new plot - when you do that depends on when you want to allow another plot again (for example after X bars, when the conditions are not fulfilled anymore or with the opposite plot etc.).

 
Code
Variables:
haveBuyPlot ( false );

if close of Data2 >= Range of Data1 and haveBuyPlot = false then
	begin
        haveBuyPlot = true ;
	Plot1( Low - offset, "Buy") ;
	end;
Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #5 (permalink)
Elite Member
Montreal
 
Futures Experience: Intermediate
Platform: MultiCharts
Broker/Data: IB Canada/IQFeed
Favorite Futures: TF, CL
 
Posts: 261 since Jul 2011
Thanks: 288 given, 332 received


ABCTG View Post
olobay,

you could use a boolean variable that you check together with your condition. If your conditions are met, you will set the boolean to true as well. Now you just have to reset the boolean to false again in order to allow for a new plot - when you do that depends on when you want to allow another plot again (for example after X bars, when the conditions are not fulfilled anymore or with the opposite plot etc.).

Regards,

ABCTG

Thanks for the help. I understand in English what I need to do, but I have no idea how I should state it or where to place it in the code. I want to have only one bar with a dot and alternating dots, one for a sell and the next for a buy and the next for a sell again. This only plots once on the first occurrence on the chart.

 
Code
input: offset(.05);

variables: Range(0), haveBuyPlot(false), haveSellPlot(false);

Range=(Open + Close) /2;

if close of Data2 >= Range of Data1 and haveBuyPlot = false then
	begin
	haveBuyPlot = true ;
	Plot1( Low - offset, "Buy") ;
	end;
	
if close of Data2 <= Range of Data1 and haveSellPlot = false then
	begin
	haveSellPlot = true ;
	Plot1( High + offset, "Sell") ;
	end;

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,527 since Apr 2013
Thanks: 229 given, 853 received
Forum Reputation: Legendary

olobay,

your code correctly does the first part of "If your conditions are met, you will set the boolean to true", you just need to do the second part "reset the boolean to false again [...] with the opposite plot". This is missing in the code and that's why you just get one plot for the very first occurrence at the moment.

In other words, when you set haveBuyPlot to true, you need to set haveSellPlot to false and vice versa. This will allow a new plot the next time your conditions are fulfilled.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:

Reply



futures io > > > > Plot only once help

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
Plot this! Pitrader EasyLanguage Programming 1 September 15th, 2015 01:55 PM
indicator will not plot MilfordT NinjaTrader 5 October 6th, 2014 07:46 PM
Overnight H L plot? keymoo NinjaTrader 8 May 1st, 2012 06:20 AM
Plot only if true Locust EasyLanguage Programming 3 October 27th, 2010 03:30 PM
Could you help me with this plot??? andaluz NinjaTrader Programming 2 May 30th, 2010 08:54 PM


All times are GMT -4. The time now is 10:19 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.09 seconds with 20 queries on phoenix via your IP 54.90.92.204