NexusFi: Find Your Edge


Home Menu

 





Easylanguage help needed, from signal to function


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one jjsshh with 7 posts (0 thanks)
    2. looks_two ABCTG with 6 posts (3 thanks)
    3. looks_3 wldman with 1 posts (2 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,899 views
    2. thumb_up 5 thanks given
    3. group 3 followers
    1. forum 14 posts
    2. attach_file 0 attachments




 
Search this Thread

Easylanguage help needed, from signal to function

  #11 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

jjsshh,

as far as I know you can't use conditions within a switch/case expression.
This is how I would start, using flags to set the marketposition. These flags will become true when your entry conditions are met. On the next bar the variable MyMarketPosition would receive the status of the position. This will ensure that the value for MyMarketPosition is aligned with the position of your signal (as you are using orders for the next bar).

This should give you a foundation to work on the exit part.

Regards,
ABCTG

 
Code
Variables:
	GoLong			( false ),
	GoShort		( false ),
	EntCondL 		( false ),
	EntCondS 		( false ),
	MyEntryBar		( 0 ),
	MyMarketPosition	( 0 );

//set long market position and store entry barnumber
if GoLong then
begin
	MyMarketPosition = + 1 ;
	GoLong = false ;
	MyEntryBar = CurrentBar ;
end ;

//set short market position and store entry barnumber
if GoShort then
begin
	MyMarketPosition = - 1 ;
	GoShort = false ;
	MyEntryBar = CurrentBar ;
end ;
	
{ Entry orders }
If MyMarketPosition = 0 and EntCondL then 
	GoLong = true ;

If MyMarketPosition = 0 and EntCondS and EntCondL = false then
	GoShort = true ;

Follow me on Twitter Reply With Quote
Thanked by:

Can you help answer these questions
from other members on NexusFi?
Better Renko Gaps
The Elite Circle
Pivot Indicator like the old SwingTemp by Big Mike
NinjaTrader
Exit Strategy
NinjaTrader
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Trade idea based off three indicators.
Traders Hideout
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
Diary of a simple price action trader
26 thanks
Just another trading journal: PA, Wyckoff & Trends
25 thanks
Tao te Trade: way of the WLD
22 thanks
My NQ Trading Journal
16 thanks
HumbleTraders next chapter
9 thanks
  #12 (permalink)
jjsshh
Helsinki, Finland
 
Posts: 23 since Dec 2013
Thanks Given: 14
Thanks Received: 4

Ok,

and thanks. The problem may be due to a switch/case. I will try make exits on my own.

Reply With Quote
  #13 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627


jjsshh,

did you succeed with the exits?

Regards,
ABCTG


jjsshh View Post
Ok,

and thanks. The problem may be due to a switch/case. I will try make exits on my own.


Follow me on Twitter Reply With Quote
  #14 (permalink)
jjsshh
Helsinki, Finland
 
Posts: 23 since Dec 2013
Thanks Given: 14
Thanks Received: 4

No, i have tried several solutions, but none of them is working. How do you handle the open price which is used in stops? Do you store it in GoLong or Goshort condition?

Reply With Quote
  #15 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,433 since Apr 2013
Thanks Given: 481
Thanks Received: 1,627

jjsshh,

yes, so it's the open of the bar where the marketposition is changed. Which would be the entry bar.

Regards,
ABCTG


jjsshh View Post
No, i have tried several solutions, but none of them is working. How do you handle the open price which is used in stops? Do you store it in GoLong or Goshort condition?


Follow me on Twitter Reply With Quote




Last Updated on August 5, 2014


© 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