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,939 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

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?
NexusFi Journal Challenge - May 2024
Feedback and Announcements
How to apply profiles
Traders Hideout
NT7 Indicator Script Troubleshooting - Camarilla Pivots
NinjaTrader
Better Renko Gaps
The Elite Circle
Quant vue
Trading Reviews and Vendors
 
Best Threads (Most Thanked)
in the last 7 days on NexusFi
What is Markets Chat (markets.chat) real-time trading ro …
72 thanks
Spoo-nalysis ES e-mini futures S&P 500
55 thanks
Just another trading journal: PA, Wyckoff & Trends
27 thanks
Bigger Wins or Fewer Losses?
24 thanks
The Program
16 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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628


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,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,628

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