Will this signal works on EURUSD?  [SOLVED]

Questions about MultiCharts and user contributed studies.
imoneyfish
Posts: 38
Joined: 26 Oct 2011
Has thanked: 6 times
Been thanked: 2 times

Will this signal works on EURUSD?

Postby imoneyfish » 13 Sep 2012

I am doing a signal based on EURUSD, the idea was, set a priceX, e.g. 1.29000, and set a step say every 25 pips. and a buffer zone for going long , e.g. 5 pips.

so if price reach 1.29000+-step then sell; if price reach 1.29000+-step+buffer zone pips then buy.

In details is Sell @1.29000;1.29250;1.29500;129750;1.30000 etc. and buy @1.29050;1.29300;1.29550;1.29800;1.30050 etc.

my code looks below.

Code: Select all

[IntrabarOrderGeneration = true]

inputs: priceX(1.25000),
step (0.00250),
buff (0.00050);

vars: Count(0);

Count= Count + 1;

if close = priceX + Count * step + buff then buy next bar at market;
if close = priceX + Count * step then sell short next bar at market;
It's not give me any trade? Who can correct my code please. Many thanks.

User avatar
TJ
Posts: 7742
Joined: 29 Aug 2006
Location: Global Citizen
Has thanked: 1033 times
Been thanked: 2222 times

Re: Will this signal works on EURUSD?

Postby TJ » 13 Sep 2012

I am doing a signal based on EURUSD, the idea was, set a priceX, e.g. 1.29000, and set a step say every 25 pips. and a buffer zone for going long , e.g. 5 pips.

so if price reach 1.29000+-step then sell; if price reach 1.29000+-step+buffer zone pips then buy.

In details is Sell @1.29000;1.29250;1.29500;129750;1.30000 etc. and buy @1.29050;1.29300;1.29550;1.29800;1.30050 etc.

my code looks below.

Code: Select all

[IntrabarOrderGeneration = true]

inputs: priceX(1.25000),
step (0.00250),
buff (0.00050);

vars: Count(0);

Count= Count + 1;

if close = priceX + Count * step + buff then buy next bar at market;
if close = priceX + Count * step then sell short next bar at market;
It's not give me any trade? Who can correct my code please. Many thanks.
Before you jump head first into writing a strategy,
I would suggest you to start the logic with an indicator:

Replace BUY and SELL with a PLOT. e.g plot a large red dot where you think you want to sell, and plot a large blue dot where you want to buy. This way you can visually inspect your logic on the chart before getting into the nitty-gritty syntax of buying and selling.

imoneyfish
Posts: 38
Joined: 26 Oct 2011
Has thanked: 6 times
Been thanked: 2 times

Re: Will this signal works on EURUSD?

Postby imoneyfish » 13 Sep 2012

the beauty of Multicharts is that signal is not hard to write. I just find writing a signal is the same work of writing a indicator. if i can't get a signal done, i can't get a indicator done. ^_^

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Will this signal works on EURUSD?

Postby Henry MultiСharts » 13 Sep 2012

imoneyfish, just Print out the price values your code generates and compare it with the bar close values of the chart.

User avatar
Henry MultiСharts
Posts: 9165
Joined: 25 Aug 2011
Has thanked: 1264 times
Been thanked: 2957 times

Re: Will this signal works on EURUSD?  [SOLVED]

Postby Henry MultiСharts » 18 Sep 2012

Solved in the live chat. The script was generating orders with unrealistic price.


Return to “MultiCharts”