NexusFi: Find Your Edge


Home Menu

 





Help with EasyLanguage


Discussion in EasyLanguage Programming

Updated
      Top Posters
    1. looks_one yofrankie1 with 6 posts (0 thanks)
    2. looks_two chik with 4 posts (1 thanks)
    3. looks_3 ABCTG with 2 posts (0 thanks)
    4. looks_4 Quick Summary with 1 posts (0 thanks)
    1. trending_up 3,591 views
    2. thumb_up 1 thanks given
    3. group 3 followers
    1. forum 12 posts
    2. attach_file 2 attachments




 
Search this Thread

Help with EasyLanguage

  #1 (permalink)
yofrankie1
KS/Olathe
 
Posts: 6 since Jan 2017
Thanks Given: 0
Thanks Received: 0

Hey,

I need some help with EasyLanguage. I am designing a system that will go LONG on a pullback when the CURRENT price crosses the 10 day EMA. My question is this: I can not find a function for CURRENT PRICE. I know about current bid and ask, but is there anyway I put current price instead of the bid and ask? For example: $AMZN is up 30 points in premarket. I wait for a pullback and go long only when the CURRENT price crosses the 10 day EMA on the 30minute chart. How do I code current price into the system? I hope this question made sense.

Thanks in advance!
Frankie.

Reply With Quote

Can you help answer these questions
from other members on NexusFi?
How to apply profiles
Traders Hideout
MC PL editor upgrade
MultiCharts
Cheap historycal L1 data for stocks
Stocks and ETFs
Trade idea based off three indicators.
Traders Hideout
REcommedations for programming help
Sierra Chart
 
  #3 (permalink)
 chik 
San Diego, California
 
Experience: Advanced
Platform: MultiCharts
Trading: ES, NQ
Posts: 26 since Mar 2016
Thanks Given: 0
Thanks Received: 22


Use "close" or "c" for short. That will be the current closing price of your thirty-minute bar. If you use intrabar order generation, it will be the latest tick price, though intrabar order generation may cause many more trades.

Further, you may want to use "c crosses above ema" for your trigger and not "c>ema", as "c crosses above ema" is an event while "c>ema" is a state.

Reply With Quote
Thanked by:
  #4 (permalink)
yofrankie1
KS/Olathe
 
Posts: 6 since Jan 2017
Thanks Given: 0
Thanks Received: 0

Hey Chic,

But 'close' wont trigger a buy until the bar closes right? How do I trigger a buy as soon as the price hits the EMA?

Thank you for your reply!
Frankie.

Reply With Quote
  #5 (permalink)
 ABCTG   is a Vendor
 
Posts: 2,436 since Apr 2013
Thanks Given: 482
Thanks Received: 1,629

Frankie,

that depends on your code. When you don't use intrabar order generation you can only issue orders end of the bar.

With intrabar order generation you can trigger orders as soon as your conditions are met (using Close you can access the current last price then).

Regards,

ABCTG

Follow me on Twitter Reply With Quote
  #6 (permalink)
yofrankie1
KS/Olathe
 
Posts: 6 since Jan 2017
Thanks Given: 0
Thanks Received: 0

AAAAAAA thats exactly what I needed:

IntrabarOrderGeneration = TRUE;

Thank you for your help! Cha ching problem solved

Reply With Quote
  #7 (permalink)
 chik 
San Diego, California
 
Experience: Advanced
Platform: MultiCharts
Trading: ES, NQ
Posts: 26 since Mar 2016
Thanks Given: 0
Thanks Received: 22

You can also have a resting stop on the EMA: "buy next bar at EMA stop"

Reply With Quote
  #8 (permalink)
yofrankie1
KS/Olathe
 
Posts: 6 since Jan 2017
Thanks Given: 0
Thanks Received: 0

Hey guys,

Take a look at the code below:

inputs: EMAType (10), //Which EMA to use

StopLoss (500),
ProfitTaking (1500);

variables: EMA_Trigger (0),
BullCross (false);


//Main Program

EMA_Trigger = XAverage(Close, EMAType); //EMA
BullCross = CurrentBid crosses under EMA_Trigger;

If (BullCross) then
begin

[IntrabarOrderGeneration = True]
Buy 1000 shares this bar at Close;

end;

SetStopPosition;
SetStopLoss(StopLoss);
SetStopPosition;
SetProfitTarget(ProfitTaking);

I have attached a screenshot of the result of this code.

Why is the buy order not getting executed at Point A in the screenshot? The point when the current price hits the EMA? Isn't that the point of IntrabarOrderGeneration function?

Please keep in mind I am a non programmer

Thank you,
Frankie!

Reply With Quote
  #9 (permalink)
 chik 
San Diego, California
 
Experience: Advanced
Platform: MultiCharts
Trading: ES, NQ
Posts: 26 since Mar 2016
Thanks Given: 0
Thanks Received: 22

Enable [IntrabarOrderGeneration = True] at the top of the script, above your inputs, not after (BullCross) turns true.

Reply With Quote
  #10 (permalink)
yofrankie1
KS/Olathe
 
Posts: 6 since Jan 2017
Thanks Given: 0
Thanks Received: 0


Still the buy order is getting executed at the same place...

Reply With Quote




Last Updated on January 4, 2017


© 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