IOG one entry per signal - EasyLanguage Programming | futures io social day trading
futures io futures trading


IOG one entry per signal
Updated: Views / Replies:567 / 10
Created: by kagein 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 100,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
 

IOG one entry per signal

  #1 (permalink)
Trading Apprentice
London
 
Futures Experience: Advanced
Platform: Stellar
Broker/Data: Marex
Favorite Futures: BUND
 
Posts: 4 since May 2013
Thanks: 2 given, 1 received

IOG one entry per signal

I'm very new to EasyLanguage, this is my first ever attempt at programming but I'm stuck.

I'm trying to get a counter working so i only enter the market once per signal, not with every tick, when IOG is switched on. I've tried adding a counter function to long trades but I'm still having multiple entries. Could any of you tell me where I'm going wrong? Thanks


 
Code
[IntrabarOrderGeneration = True];

Inputs:
	Lots(1),
	ProfitTarget(1),
	StopLoss(6),	
	FastMovingAverage(50),
	SlowMovingAverage(100),
	RSIperiod(5),
	RsiOverbought(70),
	RsiOversold(30),
	HighestLowestRange(5),
	Orderdistance(5);
	
	
	
		

Vars:
	Ticsize(MinMove / PriceScale),
	fastavg(0),
	slowavg(0),
	myRSI(0),
	LimitPrice(0),
	TargetPrice(0),
	StopPrice(0),
	LongEntry(false),
	ShortEntry(false), 
	MP(0), // Marketposition
	intrabarpersist Count(0);
		
// Moving average and RSI variables
	
fastavg = Average(close,FastMovingAverage);
slowavg = Average(close,SlowMovingAverage);
myRSI = RSI(close,RSIperiod);
MP = marketposition(0);
count = 0;



// Long condition

If fastavg > slowavg and myRSI < RsiOversold and MP <> -1  then // also checks not short market
begin
	LongEntry = True ;
	end
else
	LongEntry = False;
	
	
// Short condition
If fastavg < slowavg and myRSI > RsiOverbought and MP <> 1  then // checks pnot long market
begin
	ShortEntry = True ;
	
	end
else
	ShortEntry = False;
	
	
	

//---------------------------------------------------Position Management---------------------------------------------//

//Long Entry


If LongEntry = True and count < 2 then		// Records limit, profit, and stop prices and places an order
begin
		LimitPrice = Lowest(low,HighestLowestRange);
		TargetPrice = LimitPrice + (ProfitTarget * Ticsize);
		StopPrice = LimitPrice - (StopLoss * Ticsize);
		Buy("entryL") lots contracts next bar at LimitPrice limit;	
		count = count + 1;	
end;


// Short entry 

If ShortEntry = True then
begin
		LimitPrice = Highest(high,HighestLowestRange);
		TargetPrice = LimitPrice -(ProfitTarget * Ticsize);
		StopPrice = LimitPrice + (StopLoss * Ticsize);
		Sellshort("entryS") lots contracts next bar at LimitPrice limit;
			
end;



// Stop Loss and Profit Target

If MarketPosition <> 0 then
begin
	setprofittarget_pt(Profittarget);
	setstoploss_pt(StopLoss);
		
end;

Reply With Quote
 
  #2 (permalink)
Quick Summary
Quick Summary Post

Quick Summary is created and edited by users like you... Add FAQ's, Links and other Relevant Information by clicking the edit button in the lower right hand corner of this message.

 
  #3 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,781 since Apr 2013
Thanks: 284 given, 1,067 received


kagein,

I would suggest that you take a look at the reserved word print. This allows you to print internal study values to the output / print log and can help you tremendously in finding out what is going on within your code.

In your case I'd check the value that count holds at the beginning, before you increment it and maybe at the end of the code.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #4 (permalink)
Trading Apprentice
Hong Kong, China
 
Futures Experience: Beginner
Platform: metatrader
Favorite Futures: Futures
 
Posts: 14 since Apr 2017
Thanks: 0 given, 1 received

Very nice and comprehensive coding.

First, You give 1 contracts on trade per Execute on signal,
but you allow more than 1 contracts on Property,
thus, IOG on will give more trade within Same bar.

RightClick -> Format Signal -> Properties... -> Position limit (Uncheck) Allow add to 10 entry orders in the same xxx


Besides, for coding, you add additional Checking:

if XXX and barssinceentry > 1 then to avoid extra entry within the same bar


Reply With Quote
 
  #5 (permalink)
Trading Apprentice
Hong Kong, China
 
Futures Experience: Beginner
Platform: metatrader
Favorite Futures: Futures
 
Posts: 14 since Apr 2017
Thanks: 0 given, 1 received

Oh Sorry, as you use limit order, it is NOT yet execute and throw the entry out IOG.

barssinceentry > 1 fail to skip extra orders.

New variable to carry BarNumber and NOT to throw order again within the same bar:

variable: LastOrderBarNumber(0);


If LongEntry = True and count < 2 and LastOrderBarNumber <> BarNumber then // Records limit, profit, and stop prices and places an order
begin
LimitPrice = Lowest(low,HighestLowestRange);
TargetPrice = LimitPrice + (ProfitTarget * Ticsize);
StopPrice = LimitPrice - (StopLoss * Ticsize);
Buy("entryL") lots contracts next bar at LimitPrice limit;
count = count + 1;
LastOrderBarNumber = BarNumber;
end;

=============================================================

barssinceentry > 1 only work if you give NEXT bar at market, but fail on limit orders

Reply With Quote
 
  #6 (permalink)
Trading Apprentice
London
 
Futures Experience: Advanced
Platform: Stellar
Broker/Data: Marex
Favorite Futures: BUND
 
Posts: 4 since May 2013
Thanks: 2 given, 1 received

Thanks a lot, i think i understand a bit better now.

On another note, I'm trying to manage a position once i've been filled. So essentially i want to move my profit target if three bars have passed since I've been in the trade. This is the code I've come up with, it doesn't seem to be doing the what i expect. IOG is false.

 
Code
//short


if marketposition = -1 then begin
	barnum = BarNumber;
	condit1 = (currentbar - barnum)=0;	//cuurentbar = entrybar
	condit2 = (currentbar - barnum)=3; // 3 bars away from  entry
	
	If condit1 = true then begin
	
		setstoploss_pt(stoploss);
		setprofittarget_pt(profittarget);
	end;
	
	If condit2 = true then begin
	
	setstoploss_pt(stoploss);
	setprofittarget_pt(0);
	end;
	
end;

Could you point to my mistake?


Last edited by kagein; July 1st, 2017 at 09:01 PM.
Reply With Quote
 
  #7 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,781 since Apr 2013
Thanks: 284 given, 1,067 received

kagein,

what does the code do and what did you expect it do? This would help to know to point you in the right direction.

Regards,

ABCTG

Reply With Quote
 
  #8 (permalink)
Trading Apprentice
London
 
Futures Experience: Advanced
Platform: Stellar
Broker/Data: Marex
Favorite Futures: BUND
 
Posts: 4 since May 2013
Thanks: 2 given, 1 received

so what its meant to do is, when a limit order is filled it places a stop and a profit target. Three bars after entry, it then should move the profit target to entry(to scratch the trade). Leaving the stop where it is.

What it actually does is the first part, it just places the stop and profit target once the position is opened. The second part of the code doesn't do anything.

Reply With Quote
 
  #9 (permalink)
 Vendor: www.abctradinggroup.com 
Hamburg Germany
 
Futures Experience: Advanced
Platform: Multicharts, Tradestation
Broker/Data: DTN IQ
Favorite Futures: ES
 
Posts: 1,781 since Apr 2013
Thanks: 284 given, 1,067 received

kagein,

check what values "currentbar" and "barnum" actually hold. The print reserved word could be helpful here, too.

On a separate matter the build in stop/target related reserved words should not be placed within conditional statements as this can impact their behavior.

Regards,

ABCTG

Reply With Quote
The following user says Thank You to ABCTG for this post:
 
  #10 (permalink)
Trading Apprentice
London
 
Futures Experience: Advanced
Platform: Stellar
Broker/Data: Marex
Favorite Futures: BUND
 
Posts: 4 since May 2013
Thanks: 2 given, 1 received


Ok, using the print value i saw that my variable barnum always = 0. so i used the function barssinceentry and everything seems to work.

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

Reply



futures io > > > > > IOG one entry per signal




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

September Journal Challenge (sponsored by TopstepTrader)

September

Free Elite Membership: Twitter Tuesday and Facebook Friday!

Tue & Fri

TopstepTrader (TBD)

Sep 25

RandBots (TBD)

Sep 27

Anthony Drager (TBD)

Oct 4
     

Similar Threads
Thread Thread Starter Forum Replies Last Post
Question about IOG in Multicharts auato MultiCharts 3 April 29th, 2017 03:26 PM
Indicator with IOG TraderWalrus MultiCharts 1 August 26th, 2016 07:05 AM
Dynamic calculation of R/R after an entry signal AquaLife NinjaTrader Programming 1 October 22nd, 2014 04:00 PM
Issue with IOG and at market SlowCarry MultiCharts 10 August 10th, 2012 06:36 AM
BEST BEST Entry Signal dimitri The Elite Circle 11 January 28th, 2011 06:47 AM


All times are GMT -4. The time now is 02:10 PM. (this page content is cached, log in for real-time version)

Copyright © 2018 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 2018-09-22 in 0.15 seconds with 14 queries on phoenix